Skip to content

Commit

Permalink
fix #301 use markdown docs, but not in man-roxygen templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Feb 27, 2019
1 parent 1094a7e commit 9d74f98
Show file tree
Hide file tree
Showing 86 changed files with 1,090 additions and 1,122 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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: 0.8.4.9100
Version: 0.8.4.9510
License: MIT + file LICENSE
Encoding: UTF-8
Language: en-US
Expand All @@ -26,6 +26,7 @@ URL: https://github.com/ropensci/rnoaa
BugReports: https://github.com/ropensci/rnoaa/issues
LazyData: true
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Imports:
utils,
crul (>= 0.7.0),
Expand Down
14 changes: 7 additions & 7 deletions R/arc2.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#'
#' @export
#' @param date a date of form YYYY-MM-DD
#' @param ... curl options passed on to \code{\link[crul]{HttpClient}}
#' @param ... curl options passed on to [crul::verb-GET]
#' @references docs:
#' \url{ftp://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/ARC2_readme.txt}
#' <ftp://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/ARC2_readme.txt>
#' @return a tibble/data.frame with columns:
#' \itemize{
#' \item lon - longitude
#' \item lat - latitude
#' \item precip - precipitation
#' }
#'
#' - lon - longitude
#' - lat - latitude
#' - precip - precipitation
#'
#' @examples \dontrun{
#' arc2(date = "1983-01-01")
#' arc2(date = "2017-02-14")
Expand Down
28 changes: 10 additions & 18 deletions R/bsw.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#' mean exactly yet. Default: uv
#' @param resolution (character) temporal resolution. one of 6hrly,
#' clm, daily, or monthly. See Details.
#' @param ... curl options passed on to \code{\link[crul]{HttpClient}}
#' @return an object of class \code{ncdf4}
#' @param ... curl options passed on to [crul::verb-GET]
#' @return an object of class `ncdf4`
#'
#' @details
#' Products are available from July 9th, 1987 - present.
#'
#' Uses \code{ncdf4} under the hood to read NetCDF files
#' Uses `ncdf4` under the hood to read NetCDF files
#'
#' Use \code{bsw_cache} object to manage cached files.
#' Use `bsw_cache` object to manage cached files.
#'
#' @section Citing NOAA and BSW data:
#' Message from NOAA: "We also ask you to acknowledge us in your use of the
Expand All @@ -33,21 +33,20 @@
#' appreciate receiving a copy of the relevant publication."
#'
#' @section Temporal resolution:
#' \itemize{
#' \item 6hrly: 6-hourly, 4 global snapshots (u,v) at UTC 00, 06, 12 and 18Z
#' \item clm: climatological monthlies; also provided is the scalar
#'
#' - 6hrly: 6-hourly, 4 global snapshots (u,v) at UTC 00, 06, 12 and 18Z
#' - clm: climatological monthlies; also provided is the scalar
#' mean (u,v,w)
#' \item daily: averages of the 6hrly time points, thus with a center time
#' - daily: averages of the 6hrly time points, thus with a center time
#' 09Z; also provided is the scalar mean, (u,v,w)
#' \item monthly: averages of daily data; also provided is the scalar
#' - monthly: averages of daily data; also provided is the scalar
#' mean (u,v,w)
#' }
#'
#' @note We only handle the netcdf files for now, we're avoiding the ieee
#' files, see http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/ieee.html
#'
#' @references
#' \url{https://www.ncdc.noaa.gov/data-access/marineocean-data/blended-global/blended-sea-winds}
#' <https://www.ncdc.noaa.gov/data-access/marineocean-data/blended-global/blended-sea-winds>
#' ftp://eclipse.ncdc.noaa.gov/pub/seawinds/
#' ieee files: http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/ieee.html
#'
Expand Down Expand Up @@ -126,13 +125,6 @@ bsw_get <- function(year, month, day, uv_stress, resolution,
key <- bsw_key(year, month, day, uv_stress, resolution)
}

# file <- file.path(
# bsw_cache$cache_path_get(),
# paste0(
# switch(resolution, '6hrly' = "6hrly_", daily = "daily_", ""),
# basename(key)
# )
# )
file <- file.path(
bsw_cache$cache_path_get(),
uv_stress,
Expand Down
45 changes: 22 additions & 23 deletions R/buoy.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@
#' @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 refresh (logical) Whether to use cached data (\code{FALSE}) or get
#' new data (\code{FALSE}). Default: \code{FALSE}
#' @param ... Curl options passed on to \code{\link[crul]{HttpClient}}.
#' @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]
#' Optional. A number of different HTTP requests are made internally, but
#' we only pass this on to the request to get the netcdf file in the internal
#' function \code{get_ncdf_file()}
#' function `get_ncdf_file()`
#'
#' @details Functions:
#' \itemize{
#' \item buoy_stations - Get buoy stations. A cached version of the dataset
#'
#' - buoy_stations - Get buoy stations. A cached version of the dataset
#' is available in the package. Beware, takes a long time to run if you
#' do \code{refresh = TRUE}
#' \item buoys - Get available buoys given a dataset name
#' \item buoy - Get data given some combination of dataset name, buoy ID,
#' do `refresh = TRUE`
#' - buoys - Get available buoys given a dataset name
#' - buoy - Get data given some combination of dataset name, buoy ID,
#' year, and datatype
#' }
#'
#' Options for the dataset parameter. One of:
#' \itemize{
#' \item adcp - Acoustic Doppler Current Profiler data
#' \item adcp2 - MMS Acoustic Doppler Current Profiler data
#' \item cwind - Continuous Winds data
#' \item dart - Deep-ocean Assessment and Reporting of Tsunamis data
#' \item mmbcur - Marsh-McBirney Current Measurements data
#' \item ocean - Oceanographic data
#' \item pwind - Peak Winds data
#' \item stdmet - Standard Meteorological data
#' \item swden - Spectral Wave Density data with Spectral Wave Direction data
#' \item wlevel - Water Level data
#' }
#' @references \url{http://www.ndbc.noaa.gov/}, \url{http://dods.ndbc.noaa.gov/}
#'
#' - adcp - Acoustic Doppler Current Profiler data
#' - adcp2 - MMS Acoustic Doppler Current Profiler data
#' - cwind - Continuous Winds data
#' - dart - Deep-ocean Assessment and Reporting of Tsunamis data
#' - mmbcur - Marsh-McBirney Current Measurements data
#' - ocean - Oceanographic data
#' - pwind - Peak Winds data
#' - stdmet - Standard Meteorological data
#' - swden - Spectral Wave Density data with Spectral Wave Direction data
#' - wlevel - Water Level data
#'
#' @references <http://www.ndbc.noaa.gov/>, <http://dods.ndbc.noaa.gov/>
#' @examples \dontrun{
#' # Get buoy station information
#' x <- buoy_stations()
Expand Down
6 changes: 3 additions & 3 deletions R/caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#'
#' @name caching
#' @param force (logical) Should we force removal of files if permissions
#' say otherwise?. Default: \code{FALSE}
#' say otherwise?. Default: `FALSE`
#'
#' @details BEWARE: this will clear all cached files.
#'
#' @section File storage:
#' We use \pkg{rappdirs} to store files, see
#' \code{\link[rappdirs]{user_cache_dir}} for how
#' [rappdirs::user_cache_dir()] for how
#' we determine the directory on your machine to save files to, and run
#' \code{user_cache_dir("rnoaa")} to get that directory.
#' `user_cache_dir("rnoaa")` to get that directory.

#' @export
#' @rdname caching
Expand Down
82 changes: 40 additions & 42 deletions R/coops.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,67 @@
#' of the station with its lat/lon values, and assign that time zone.
#' @param application (character) If called within an external package, set
#' to the name of your organization. Optional
#' @param ... Curl options passed on to \code{\link[crul]{HttpClient}}.
#' @param ... Curl options passed on to [crul::verb-GET]
#' Optional
#'
#' @details
#' Options for the product paramter. One of:
#' \itemize{
#' \item water_level - Preliminary or verified water levels, depending on
#'
#' - water_level - Preliminary or verified water levels, depending on
#' availability
#' \item air_temperature - Air temperature as measured at the station
#' \item water_temperature - Water temperature as measured at the station
#' \item wind - Wind speed, direction, and gusts as measured at the station
#' \item air_pressure - Barometric pressure as measured at the station
#' \item air_gap - Air Gap (distance between a bridge and the water's surface)
#' - air_temperature - Air temperature as measured at the station
#' - water_temperature - Water temperature as measured at the station
#' - wind - Wind speed, direction, and gusts as measured at the station
#' - air_pressure - Barometric pressure as measured at the station
#' - air_gap - Air Gap (distance between a bridge and the water's surface)
#' at the station
#' \item conductivity - The water's conductivity as measured at the station
#' \item visibility - Visibility from the station's visibility sensor. A
#' - conductivity - The water's conductivity as measured at the station
#' - visibility - Visibility from the station's visibility sensor. A
#' measure of atmospheric clarity
#' \item humidity - Relative humidity as measured at the station
#' \item salinity - Salinity and specific gravity data for the station
#' \item one_minute_water_level - One minute water level data for the station
#' \item predictions - 6 minute predictions water level data for the station
#' \item hourly_height - Verified hourly height water level data for
#' - humidity - Relative humidity as measured at the station
#' - salinity - Salinity and specific gravity data for the station
#' - one_minute_water_level - One minute water level data for the station
#' - predictions - 6 minute predictions water level data for the station
#' - hourly_height - Verified hourly height water level data for
#' the station
#' \item high_low - Verified high/low water level data for the station
#' \item daily_mean - Verified daily mean water level data for the station
#' \item monthly_mean - Verified monthly mean water level data for the station
#' \item datums - datums data for the stations
#' \item currents - Currents data for currents stations
#' }
#' - high_low - Verified high/low water level data for the station
#' - daily_mean - Verified daily mean water level data for the station
#' - monthly_mean - Verified monthly mean water level data for the station
#' - datums - datums data for the stations
#' - currents - Currents data for currents stations
#'
#' Maximum Durations in a Single Call:
#' \itemize{
#' \item Products water_level through predictions allow requests for up to
#'
#' - Products water_level through predictions allow requests for up to
#` 31 days of data.
#' \item Products hourly_height and high_low allow requests for up to
#' - Products hourly_height and high_low allow requests for up to
#` 1 year (366 days) of data.
#' \item Products daily_mean and monthly_mean allow requests for up to
#' - Products daily_mean and monthly_mean allow requests for up to
#` 10 years of data.
#' }#'
#'
#' Options for the datum parameter. One of:
#' \itemize{
#' \item MHHW - Mean higher high water
#' \item MHW - Mean high water
#' \item MTL - Mean tide level
#' \item MSL - Mean sea level
#' \item MLW - Mean low water
#' \item MLLW - Mean lower low water
#' \item NAVD - North American Vertical Datum
#' \item STND - Station datum
#' }
#'
#' - MHHW - Mean higher high water
#' - MHW - Mean high water
#' - MTL - Mean tide level
#' - MSL - Mean sea level
#' - MLW - Mean low water
#' - MLLW - Mean lower low water
#' - NAVD - North American Vertical Datum
#' - STND - Station datum
#'
#' @references
#' \url{https://tidesandcurrents.noaa.gov/api/}
#' <https://tidesandcurrents.noaa.gov/api/>
#'
#' \url{https://tidesandcurrents.noaa.gov/map/}
#' <https://tidesandcurrents.noaa.gov/map/>
#'
#' @author Scott Chamberlain, Joseph Stachelek, Tom Philippi
#'
#' @return List, of length one or two.
#' \itemize{
#' \item metadata A list of metadata with slots id, name, lat, lon
#' \item data A data.frame with data
#' }
#'
#' - metadata A list of metadata with slots id, name, lat, lon
#' - data A data.frame with data
#'
#' @examples \dontrun{
#' # Get monthly mean sea level data at Vaca Key (8723970)
#' coops_search(station_name = 8723970, begin_date = 20120301,
Expand Down
25 changes: 12 additions & 13 deletions R/cpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
#'
#' @export
#' @param date (date/character) date in YYYY-MM-DD format
#' @param us (logical) US data only? default: \code{FALSE}
#' @param us (logical) US data only? default: `FALSE`
#' @param drop_undefined (logical) drop undefined precipitation
#' values (values in the \code{precip} column in the output data.frame).
#' default: \code{FALSE}
#' @param ... curl options passed on to \code{\link[crul]{HttpClient}}
#' values (values in the `precip` column in the output data.frame).
#' default: `FALSE`
#' @param ... curl options passed on to [crul::verb-GET]
#' @return a data.frame, with columns:
#' \itemize{
#' \item lon - longitude (0 to 360)
#' \item lat - latitude (-90 to 90)
#' \item precip - precipitation (in mm) (see Details for more information)
#' }
#'
#' @references \url{http://www.cpc.ncep.noaa.gov/}
#' - lon - longitude (0 to 360)
#' - lat - latitude (-90 to 90)
#' - precip - precipitation (in mm) (see Details for more information)
#'
#' @references <http://www.cpc.ncep.noaa.gov/>
#' ftp://ftp.cpc.ncep.noaa.gov/precip/CPC_UNI_PRCP
#' ftp://ftp.cpc.ncep.noaa.gov/precip/CPC_UNI_PRCP/GAUGE_CONUS/DOCU/PRCP_CU_GAUGE_V1.0CONUS_0.25deg.README
#' ftp://ftp.cpc.ncep.noaa.gov/precip/CPC_UNI_PRCP/GAUGE_GLB/DOCU/PRCP_CU_GAUGE_V1.0GLB_0.50deg_README.txt
Expand All @@ -29,10 +28,10 @@
#' per the CPC documentation.
#'
#' Values of -99.0 are classified as "undefined". These values can be
#' removed by setting \code{drop_undefined = TRUE} in the \code{cpc_prcp}
#' removed by setting `drop_undefined = TRUE` in the `cpc_prcp`
#' function call. These undefined values are not dropped by default -
#' so do remember to set \code{drop_undefined = TRUE} to drop them; or
#' you can easily do it yourself by e.g., \code{subset(x, precip >= 0)}
#' so do remember to set `drop_undefined = TRUE` to drop them; or
#' you can easily do it yourself by e.g., `subset(x, precip >= 0)`
#'
#' @examples \dontrun{
#' cpc_prcp(date = "2017-01-15")
Expand Down
12 changes: 6 additions & 6 deletions R/ersst.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
#' @param month A month, character or numeric. If single digit (e.g. 8), we
#' add a zero in front (e.g., 08). Required
#' @param overwrite (logical) To overwrite the path to store files in or not,
#' Default: \code{TRUE}
#' @param ... Curl options passed on to \code{\link[crul]{HttpClient}}.
#' Default: `TRUE`
#' @param ... Curl options passed on to [crul::verb-GET]
#' Optional
#'
#' @return An \code{ncdf4} object for now, may change output later to
#' @return An `ncdf4` object for now, may change output later to
#' perhaps a data.frame. See \pkg{ncdf4} for parsing the output.
#' @references
#' \url{https://www.ncdc.noaa.gov/data-access/marineocean-data/extended-reconstructed-sea-surface-temperature-ersst-v4}
#' <https://www.ncdc.noaa.gov/data-access/marineocean-data/extended-reconstructed-sea-surface-temperature-ersst-v4>
#'
#' @section File storage:
#' We use \pkg{rappdirs} to store files, see
#' \code{\link[rappdirs]{user_cache_dir}} for how we determine the directory on
#' [rappdirs::user_cache_dir()] for how we determine the directory on
#' your machine to save files to, and run
#' \code{rappdirs::user_cache_dir("rnoaa/ersst")}
#' `rappdirs::user_cache_dir("rnoaa/ersst")`
#' to get that directory.
#'
#' Files are quite small, so we don't worry about reading in cached data to
Expand Down
Loading

0 comments on commit 9d74f98

Please sign in to comment.