buoy: Get NOAA buoy data from the National Buoy Data Center

Description Usage Arguments Details References Examples

View source: R/buoy.R

Description

Get NOAA buoy data from the National Buoy Data Center

Usage

1
2
3
4
5
buoy(dataset, buoyid, year = NULL, datatype = NULL, ...)

buoys(dataset, ...)

buoy_stations(refresh = FALSE, ...)

Arguments

dataset

(character) Dataset name to query. See below for Details. Required

buoyid

Buoy ID, can be numeric/integer/character. Required

year

(integer) Year of data collection. Optional

datatype

(character) Data type, one of 'c', 'cc', 'p', 'o'. Optional

...

Curl options passed on to GET. Optional

refresh

(logical) Whether to use cached data (FALSE) or get new data (FALSE). Default: FALSE

Details

Functions:

Options for the dataset parameter. One of:

References

http://www.ndbc.noaa.gov/, http://dods.ndbc.noaa.gov/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
# Get buoy station information
x <- buoy_stations()
library("leaflet")
leaflet(data = na.omit(x)) %>%
  leaflet::addTiles() %>%
  leaflet::addCircles(~lon, ~lat, opacity = 0.5)

# Get available buoys
buoys(dataset = 'cwind')

# Get data for a buoy
## if no year or datatype specified, we get the first file
buoy(dataset = 'cwind', buoyid = 46085)

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

# Including specific year and datatype
buoy(dataset = 'cwind', buoyid = 41001, year = 2008, datatype = "cc")
buoy(dataset = 'cwind', buoyid = 41001, year = 2008, datatype = "cc")

# Other datasets
buoy(dataset = 'ocean', buoyid = 41029)

# curl debugging
library('httr')
buoy(dataset = 'cwind', buoyid = 46085, config=verbose())

# some buoy ids are character, case doesn't matter, we'll account for it
buoy(dataset = "stdmet", buoyid = "VCAF1")
buoy(dataset = "stdmet", buoyid = "wplf1")
buoy(dataset = "dart", buoyid = "dartu")

## End(Not run)

leighseverson/rnoaa documentation built on May 21, 2019, 3:06 a.m.