get_coop: Wrapper of rnoaa::coops_search that allows retrieval of more...

Description Usage Arguments Details Value Examples

View source: R/get_coop.R

Description

This function is particularly useful for retrieving tide/water level data. Other functions in this package (e.g., get_wx or get_wx_ACIS may be better suited for basic meteorological data. All the products and options available at coops_search are available here except the ability to pass additional options to Curl. We also add add optional start and end date formats to be more consistent with other functions in this package. However, calls to coops_search without Curl options should work seemlessly with a call to get_coop. See example. Note, however, we return only the data.frame data component returned by coops_search

Usage

1
2
3
get_coop(begin_date = NULL, end_date = NULL, station_name = NULL,
  product, datum = NULL, units = "metric", time_zone = "gmt",
  application = "rnoaa", start = NULL, end = NULL, verbose = TRUE)

Arguments

begin_date

(numeric) Date in yyyymmdd format. One of begin_date or start is required.

end_date

(numeric) Date in yyyymmdd format. One of end_date or end is required.

station_name

(numeric) Required station name/number. See https://tidesandcurrents.noaa.gov/map/ to locate station name and view what data product might be available.

product

(character) Specify the data type. See Details for options. Required

datum

(character) See below for Details. Required for all water level products.

units

(character) One of 'metric' (default) or 'english' (imperial)

time_zone

(character) Time zone, one of 'gmt' (default), 'lst', or 'lst_ldt'. See details at coops_search.

application

(character) If called within an external package, set to the name of your organization. Optional.

start

character or Date scalar of start date ("YYYY-MM-DD")

end

character or Date scalar of end date ("YYYY-MM-DD")

verbose

(logical) print messages while processing requests?

Details

Options for the product paramater. Not all available at every station. One of:

Options for the datum parameter. Not all available for every station. One of:

Value

A data.frame with data or NULL if no data is found

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Two months of water level data at Vaca Key (8723970)
# Fails with coops_search because query range is too long
coops_search(begin_date = 20140927, end_date = 20141115,
             station_name = 8723970, datum = "stnd",
             product = "water_level")
# Works with get_coop with exact same argument order
get_coop(begin_date = 20140927, end_date = 20141115,
         station_name = 8723970, datum = "stnd",
         product = "water_level")

## End(Not run)

adamdsmith/nrsmisc documentation built on Aug. 13, 2019, 2:14 p.m.