From 3d0101d42ea08d26b9e164ff4ae8b938ec5baaa3 Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Fri, 13 Nov 2020 14:29:10 -0800 Subject: [PATCH] fix #377 add eg and description to year param in buoy() that special value 9999 gives most recent data --- DESCRIPTION | 2 +- R/buoy.R | 7 ++++++- man/buoy.Rd | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d9894e40..498cc5dc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,7 +7,7 @@ Description: Client for many 'NOAA' data sources including the 'NCDC' climate for 'NOAA' sea ice data, the 'NOAA' severe weather inventory, 'NOAA' Historical Observing 'Metadata' Repository ('HOMR') data, 'NOAA' storm data via 'IBTrACS', tornado data via the 'NOAA' storm prediction center, and more. -Version: 1.2.1.91 +Version: 1.2.1.93 License: MIT + file LICENSE Encoding: UTF-8 Language: en-US diff --git a/R/buoy.R b/R/buoy.R index 13ca160d..a65972fa 100644 --- a/R/buoy.R +++ b/R/buoy.R @@ -6,7 +6,9 @@ #' Required #' @param buoyid Buoy ID, can be numeric/integer/character. Required #' @param datatype (character) Data type, one of 'c', 'cc', 'p', 'o'. Optional -#' @param year (integer) Year of data collection. Optional +#' @param year (integer) Year of data collection. Optional. Note there is +#' a special value `9999` that, if found, contains the most up to date +#' data. #' @param refresh (logical) Whether to use cached data (`FALSE`) or get #' new data (`FALSE`). Default: `FALSE` #' @param ... Curl options passed on to [crul::verb-GET] @@ -55,6 +57,9 @@ #' z <- leaflet::addTiles(z) #' leaflet::addCircles(z, ~lon, ~lat, opacity = 0.5) #' } +#' +#' # year=9999 to get most current data - not always available +#' buoy(dataset = "swden", buoyid = 46012, year = 9999) #' #' # Get available buoys #' buoys(dataset = 'cwind') diff --git a/man/buoy.Rd b/man/buoy.Rd index 8a545313..73ed35c2 100644 --- a/man/buoy.Rd +++ b/man/buoy.Rd @@ -18,7 +18,9 @@ Required} \item{buoyid}{Buoy ID, can be numeric/integer/character. Required} -\item{year}{(integer) Year of data collection. Optional} +\item{year}{(integer) Year of data collection. Optional. Note there is +a special value \code{9999} that, if found, contains the most up to date +data.} \item{datatype}{(character) Data type, one of 'c', 'cc', 'p', 'o'. Optional} @@ -79,6 +81,9 @@ z <- leaflet::addTiles(z) leaflet::addCircles(z, ~lon, ~lat, opacity = 0.5) } +# year=9999 to get most current data - not always available +buoy(dataset = "swden", buoyid = 46012, year = 9999) + # Get available buoys buoys(dataset = 'cwind')