# working with buoy data

#### Scott Chamberlain

#### 2020-04-06

This vignette covers NOAA buoy data from the National Buoy Data Center. The main function to get data is `buoy`, while `buoys` can be used to get the buoy IDs and web pages for each buoy.

    library('rnoaa')

## Find out what buoys are available in a dataset

    res <- buoys(dataset = "cwind")

Inspect the buoy ids, and the urls for them

    head(res)

Or browse them on the web

    browseURL(res[1, 2])

## Get buoy data

With `buoy` you can get data for a particular dataset, buoy id, year, and datatype.

Get data for a buoy

> if no year or datatype specified, we get the first file

    buoy(dataset = 'cwind', buoyid = 46085)

Including year

    buoy(dataset = 'cwind', buoyid = 41001, year = 1999)

Including year and datatype

    buoy(dataset = 'cwind', buoyid = 45005, year = 2008, datatype = "c")

Including just datatype

    buoy(dataset = 'cwind', buoyid = 45005, datatype = "c")