From f4be1e57bec8f02e13c7a604bc44c299b52682db Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Thu, 8 Sep 2016 15:30:11 -0700 Subject: [PATCH] improve ncdc docs, more info on token usage, added @family to provide better navigation links in all of the ncdc* man files bumped dev version --- DESCRIPTION | 2 +- R/ncdc.r | 3 +++ R/ncdc_combine.r | 1 + R/ncdc_datacats.r | 2 ++ R/ncdc_datasets.r | 12 ++++++---- R/ncdc_datatypes.r | 24 +++++++++++-------- R/ncdc_locs.r | 7 ++++-- R/ncdc_locs_cats.r | 2 ++ R/ncdc_plot.r | 1 + R/ncdc_stations.r | 13 ++++++---- man-roxygen/datacats.r | 7 ------ man-roxygen/location.r | 7 ------ man-roxygen/rnoaa.r | 7 ------ man-roxygen/token.R | 18 ++++++++++++++ man/ncdc.Rd | 32 +++++++++++++++++++------ man/ncdc_combine.Rd | 8 +++++++ man/ncdc_datacats.Rd | 33 ++++++++++++++++++++------ man/ncdc_datasets.Rd | 43 ++++++++++++++++++++++++--------- man/ncdc_datatypes.Rd | 54 +++++++++++++++++++++++++++++------------- man/ncdc_locs.Rd | 37 ++++++++++++++++++++++------- man/ncdc_locs_cats.Rd | 32 +++++++++++++++++++------ man/ncdc_plot.Rd | 7 ++++++ man/ncdc_stations.Rd | 43 +++++++++++++++++++++++---------- 23 files changed, 282 insertions(+), 113 deletions(-) create mode 100644 man-roxygen/token.R diff --git a/DESCRIPTION b/DESCRIPTION index 15136980..34345ad6 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: 0.6.0.9333 +Version: 0.6.0.9335 License: MIT + file LICENSE Encoding: UTF-8 Authors@R: c( diff --git a/R/ncdc.r b/R/ncdc.r index 9b7e7c1f..bcf21698 100644 --- a/R/ncdc.r +++ b/R/ncdc.r @@ -3,6 +3,7 @@ #' @export #' @template rnoaa #' @template noaa +#' @template token #' @param stationid Accepts a valid station id or a vector or list of station ids #' @param includemetadata Used to improve response time by preventing the calculation of #' result metadata. Default: TRUE. This does not affect the return object, in that the named part @@ -43,6 +44,8 @@ #' The meta slot is a list of metadata elements, and the data slot is a data.frame, #' possibly of length zero if no data is found. #' +#' @family ncdc +#' #' @examples \dontrun{ #' # GHCN-Daily (or GHCND) data, for a specific station #' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', diff --git a/R/ncdc_combine.r b/R/ncdc_combine.r index 60c1d2bb..22bc7107 100644 --- a/R/ncdc_combine.r +++ b/R/ncdc_combine.r @@ -4,6 +4,7 @@ #' #' @param ... Objects from another ncdc_* function. #' @return A data.frame +#' @family ncdc #' @examples \dontrun{ #' # data #' out1 <- ncdc(datasetid='GHCND', locationid = 'FIPS:02', startdate = '2010-05-01', diff --git a/R/ncdc_datacats.r b/R/ncdc_datacats.r index d7a20d84..6fbe5ef7 100644 --- a/R/ncdc_datacats.r +++ b/R/ncdc_datacats.r @@ -4,11 +4,13 @@ #' #' @export #' @template datacats +#' @template token #' @template all #' @return A \code{data.frame} for all datasets, or a list of length two, each #' with a data.frame. #' @details Note that calls with both startdate and enddate don't seem to work, though specifying #' one or the other mostly works. +#' @family ncdc #' @examples \dontrun{ #' ## Limit to 10 results #' ncdc_datacats(limit=10) diff --git a/R/ncdc_datasets.r b/R/ncdc_datasets.r index b32a5ba2..28758a52 100644 --- a/R/ncdc_datasets.r +++ b/R/ncdc_datasets.r @@ -8,10 +8,14 @@ #' @template rnoaa #' @template rnoaa2 #' @template datasets -#' @param datasetid (optional) Accepts a single valid dataset id. Data returned will be -#' from the dataset specified. -#' @param stationid Accepts a valid station id or a vector or list of station ids -#' @return A data.frame for all datasets, or a list of length two, each with a data.frame. +#' @template token +#' @param datasetid (optional) Accepts a single valid dataset id. Data returned +#' will be from the dataset specified. +#' @param stationid Accepts a valid station id or a vector or list of station +#' ids +#' @return A data.frame for all datasets, or a list of length two, each with +#' a data.frame. +#' @family ncdc #' @examples \dontrun{ #' # Get a table of all datasets #' ncdc_datasets() diff --git a/R/ncdc_datatypes.r b/R/ncdc_datatypes.r index 404f78ec..da42ec21 100644 --- a/R/ncdc_datatypes.r +++ b/R/ncdc_datatypes.r @@ -1,20 +1,24 @@ #' Get possible data types for a particular dataset #' -#' From the NOAA API docs: Describes the type of data, acts as a label. If it's 64 -#' degrees out right now, then the data type is Air Temperature and the data is 64. +#' From the NOAA API docs: Describes the type of data, acts as a label. +#' For example: If it's 64 degrees out right now, then the data type is +#' Air Temperature and the data is 64. #' #' @export #' @template rnoaa #' @template rnoaa2 #' @template datatypes -#' @param datasetid (optional) Accepts a valid dataset id or a vector or list of them. Data -#' returned will be from the dataset specified. -#' @param stationid Accepts a valid station id or a vector or list of station ids -#' @param datacategoryid Optional. Accepts a valid data category id or a vector or list -#' of data category ids (although it is rare to have a data type with more than -#' one data category) -#' @return A \code{data.frame} for all datasets, or a list of length two, each with -#' a data.frame. +#' @template token +#' @param datasetid (optional) Accepts a valid dataset id or a vector or list +#' of them. Data returned will be from the dataset specified. +#' @param stationid Accepts a valid station id or a vector or list of +#' station ids +#' @param datacategoryid Optional. Accepts a valid data category id or a vector +#' or list of data category ids (although it is rare to have a data type with +#' more than one data category) +#' @return A \code{data.frame} for all datasets, or a list of length two, +#' each with a data.frame +#' @family ncdc #' @examples \dontrun{ #' # Fetch available data types #' ncdc_datatypes() diff --git a/R/ncdc_locs.r b/R/ncdc_locs.r index 1985d415..90486314 100644 --- a/R/ncdc_locs.r +++ b/R/ncdc_locs.r @@ -1,13 +1,16 @@ #' Get metadata about NOAA NCDC locations. #' -#' From the NOAA NCDC API docs: Locations can be a specific latitude/longitude point -#' such as a station, or a label representing a bounding area such as a city. +#' From the NOAA NCDC API docs: Locations can be a specific latitude/longitude +#' point such as a station, or a label representing a bounding area such as +#' a city. #' #' @export #' #' @template location +#' @template token #' @param locationid A valid location id or a vector or list of location ids. #' @return A list containing metadata and the data, or a single data.frame. +#' @family ncdc #' @examples \dontrun{ #' # All locations, first 25 results #' ncdc_locs() diff --git a/R/ncdc_locs_cats.r b/R/ncdc_locs_cats.r index bb2a4b85..2d5496b4 100644 --- a/R/ncdc_locs_cats.r +++ b/R/ncdc_locs_cats.r @@ -8,7 +8,9 @@ #' @export #' #' @template location +#' @template token #' @return A list containing metadata and the data, or a single data.frame. +#' @family ncdc #' @examples \dontrun{ #' # All location categories, first 25 results #' ncdc_locs_cats() diff --git a/R/ncdc_plot.r b/R/ncdc_plot.r index 54f10d76..6e2ad42f 100644 --- a/R/ncdc_plot.r +++ b/R/ncdc_plot.r @@ -8,6 +8,7 @@ #' @param dateformat Date format using standard POSIX specification for labels on #' x-axis. See \code{\link{date_format}} #' @return ggplot2 plot +#' @family ncdc #' @details #' This function accepts directly output from the \code{\link[rnoaa]{ncdc}} function, #' not other functions. diff --git a/R/ncdc_stations.r b/R/ncdc_stations.r index c359854f..7cf995ff 100644 --- a/R/ncdc_stations.r +++ b/R/ncdc_stations.r @@ -1,19 +1,22 @@ #' Get metadata about NOAA NCDC stations. #' -#' From the NOAA NCDC API docs: Stations are where the data comes from (for most datasets) -#' and can be considered the smallest granual of location data. If you know what -#' station you want, you can quickly get all manner of data from it +#' From the NOAA NCDC API docs: Stations are where the data comes from +#' (for most datasets) and can be considered the smallest granual of location +#' data. If you know what station you want, you can quickly get all manner of +#' data from it #' #' @export #' #' @template rnoaa #' @template rnoaa2 #' @template stations -#' @param datasetid (optional) Accepts a valid dataset id or a vector or list of them. Data -#' returned will be from the dataset specified. +#' @template token +#' @param datasetid (optional) Accepts a valid dataset id or a vector or +#' list of them. Data returned will be from the dataset specified. #' @param stationid A single valid station id, with datasetid namespace, #' e.g., GHCND:USW00014895 #' @return A list of metadata. +#' @family ncdc #' @examples \dontrun{ #' # Get metadata on all stations #' ncdc_stations() diff --git a/man-roxygen/datacats.r b/man-roxygen/datacats.r index 0ded5387..b7e4140a 100644 --- a/man-roxygen/datacats.r +++ b/man-roxygen/datacats.r @@ -14,13 +14,6 @@ #' @param limit Defaults to 25, limits the number of results in the response. Maximum is #' 1000 (optional) #' @param offset Defaults to 0, used to offset the resultlist (optional) -#' @param token This must be a valid token token supplied to you by NCDC's Climate -#' Data Online access token generator. (required) Get an API key (=token) at -#' http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -#' an argument or store it in your .Rprofile file with an entry like -#' \itemize{ -#' \item options("noaakey" = "your-noaa-token") -#' } #' @param ... Further named parameters, such as \code{query}, \code{path}, etc, passed on to #' \code{\link[httr]{modify_url}}. Unnamed parameters will be combined with #' \code{\link[httr]{config}}. diff --git a/man-roxygen/location.r b/man-roxygen/location.r index d676ad72..e05c6248 100644 --- a/man-roxygen/location.r +++ b/man-roxygen/location.r @@ -11,13 +11,6 @@ #' @param limit Defaults to 25, limits the number of results in the response. Maximum is #' 1000 (optional) #' @param offset Defaults to 0, used to offset the resultlist (optional) -#' @param token This must be a valid token token supplied to you by NCDC's Climate -#' Data Online access token generator. (required) Get an API key (=token) at -#' http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -#' an argument or store it in your .Rprofile file with an entry like -#' \itemize{ -#' \item options("noaakey" = "your-noaa-token") -#' } #' @param ... Further named parameters, such as \code{query}, \code{path}, etc, passed on to #' \code{\link[httr]{modify_url}}. Unnamed parameters will be combined with #' \code{\link[httr]{config}}. diff --git a/man-roxygen/rnoaa.r b/man-roxygen/rnoaa.r index 0f92bfe7..0a11ad08 100644 --- a/man-roxygen/rnoaa.r +++ b/man-roxygen/rnoaa.r @@ -8,11 +8,4 @@ #' @param limit Defaults to 25, limits the number of results in the response. Maximum is #' 1000 (optional) #' @param offset Defaults to 0, used to offset the resultlist (optional) -#' @param token This must be a valid token token supplied to you by NCDC's Climate -#' Data Online access token generator. (required) Get an API key (=token) at -#' http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -#' an argument or store it in your .Rprofile file with an entry like -#' \itemize{ -#' \item options("noaakey" = "your-noaa-token") -#' } #' @param ... Curl options passed on to \code{\link[httr]{GET}} (optional) diff --git a/man-roxygen/token.R b/man-roxygen/token.R new file mode 100644 index 00000000..414f9ee1 --- /dev/null +++ b/man-roxygen/token.R @@ -0,0 +1,18 @@ +#' @param token This must be a valid token token supplied to you by NCDC's +#' Climate Data Online access token generator. (required) See +#' \strong{Authentication} section below for more details. +#' +#' @section Authentication: +#' Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +#' You can pass your token in as an argument or store it one of two places: +#' +#' \itemize{ +#' \item your .Rprofile file with an entry like +#' \code{options(noaakey = "your-noaa-token")} +#' \item your .Renviron file with an entry like +#' \code{NOAA_KEY=your-noaa-token} +#' } +#' +#' See \code{\link{Startup}} for information on how to create/find your +#' .Rrofile and .Renviron files + diff --git a/man/ncdc.Rd b/man/ncdc.Rd index 001b367e..29f1cdb9 100644 --- a/man/ncdc.Rd +++ b/man/ncdc.Rd @@ -41,13 +41,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} @@ -119,6 +115,21 @@ description of possible values for each flag. \item fl_u units } } +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files +} \examples{ \dontrun{ # GHCN-Daily (or GHCND) data, for a specific station @@ -210,4 +221,11 @@ ncdc(datasetid = "ANNUAL", stationid = stat$data$id[1:10], ncdc(datasetid='NEXRAD2', startdate = '2013-10-01', enddate = '2013-12-01') } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}} +} diff --git a/man/ncdc_combine.Rd b/man/ncdc_combine.Rd index 1e7c4631..c715f42d 100644 --- a/man/ncdc_combine.Rd +++ b/man/ncdc_combine.Rd @@ -65,4 +65,12 @@ out3 <- ncdc_locs_cats(locationcategoryid='CLIM_REG') ncdc_combine(out1, out2, out3) } } +\seealso{ +Other ncdc: \code{\link{ncdc_datacats}}, + \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}}, + \code{\link{ncdc}} +} diff --git a/man/ncdc_datacats.Rd b/man/ncdc_datacats.Rd index 256bf8a6..27b6199e 100644 --- a/man/ncdc_datacats.Rd +++ b/man/ncdc_datacats.Rd @@ -35,13 +35,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{...}{Further named parameters, such as \code{query}, \code{path}, etc, passed on to \code{\link[httr]{modify_url}}. Unnamed parameters will be combined with @@ -58,6 +54,21 @@ Data Categories represent groupings of data types. Note that calls with both startdate and enddate don't seem to work, though specifying one or the other mostly works. } +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files +} \examples{ \dontrun{ ## Limit to 10 results @@ -90,4 +101,12 @@ out <- ncdc_datacats(limit=10, config=progress()) \references{ Vignette at \url{http://ropensci.org/tutorials/rnoaa_tutorial.html} } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}}, + \code{\link{ncdc}} +} diff --git a/man/ncdc_datasets.Rd b/man/ncdc_datasets.Rd index 47dc1267..8b657c53 100644 --- a/man/ncdc_datasets.Rd +++ b/man/ncdc_datasets.Rd @@ -10,13 +10,14 @@ ncdc_datasets(datasetid = NULL, datatypeid = NULL, stationid = NULL, dataset = NULL, page = NULL, year = NULL, month = NULL, ...) } \arguments{ -\item{datasetid}{(optional) Accepts a single valid dataset id. Data returned will be -from the dataset specified.} +\item{datasetid}{(optional) Accepts a single valid dataset id. Data returned +will be from the dataset specified.} \item{datatypeid}{Accepts a valid data type id or a vector or list of data type ids. (optional)} -\item{stationid}{Accepts a valid station id or a vector or list of station ids} +\item{stationid}{Accepts a valid station id or a vector or list of station +ids} \item{locationid}{Accepts a valid location id or a vector or list of location ids (optional)} @@ -39,13 +40,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} @@ -61,12 +58,28 @@ arguments.} \item{...}{Curl options passed on to \code{\link[httr]{GET}} (optional)} } \value{ -A data.frame for all datasets, or a list of length two, each with a data.frame. +A data.frame for all datasets, or a list of length two, each with +a data.frame. } \description{ From the NOAA API docs: All of our data are in datasets. To retrieve any data from us, you must know what dataset it is in. } +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files +} \examples{ \dontrun{ # Get a table of all datasets @@ -94,4 +107,12 @@ ncdc_datasets(locationid="FIPS:30091") ncdc_datasets(locationid=c("FIPS:30103", "FIPS:30091")) } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}}, + \code{\link{ncdc}} +} diff --git a/man/ncdc_datatypes.Rd b/man/ncdc_datatypes.Rd index ef8fb5a6..50cbfe14 100644 --- a/man/ncdc_datatypes.Rd +++ b/man/ncdc_datatypes.Rd @@ -10,17 +10,18 @@ ncdc_datatypes(datasetid = NULL, datatypeid = NULL, datacategoryid = NULL, token = NULL, dataset = NULL, page = NULL, filter = NULL, ...) } \arguments{ -\item{datasetid}{(optional) Accepts a valid dataset id or a vector or list of them. Data -returned will be from the dataset specified.} +\item{datasetid}{(optional) Accepts a valid dataset id or a vector or list +of them. Data returned will be from the dataset specified.} \item{datatypeid}{Accepts a valid data type id or a vector or list of data type ids. (optional)} -\item{datacategoryid}{Optional. Accepts a valid data category id or a vector or list -of data category ids (although it is rare to have a data type with more than -one data category)} +\item{datacategoryid}{Optional. Accepts a valid data category id or a vector +or list of data category ids (although it is rare to have a data type with +more than one data category)} -\item{stationid}{Accepts a valid station id or a vector or list of station ids} +\item{stationid}{Accepts a valid station id or a vector or list of +station ids} \item{locationid}{Accepts a valid location id or a vector or list of location ids (optional)} @@ -43,13 +44,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} @@ -62,12 +59,28 @@ of the NOAA API.} \item{...}{Curl options passed on to \code{\link[httr]{GET}} (optional)} } \value{ -A \code{data.frame} for all datasets, or a list of length two, each with - a data.frame. +A \code{data.frame} for all datasets, or a list of length two, +each with a data.frame } \description{ -From the NOAA API docs: Describes the type of data, acts as a label. If it's 64 -degrees out right now, then the data type is Air Temperature and the data is 64. +From the NOAA API docs: Describes the type of data, acts as a label. +For example: If it's 64 degrees out right now, then the data type is +Air Temperature and the data is 64. +} +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files } \examples{ \dontrun{ @@ -95,4 +108,11 @@ ncdc_datatypes(locationid='CITY:AG000001') ncdc_datatypes(locationid=c('CITY:AG000001','CITY:AG000004')) } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}}, + \code{\link{ncdc}} +} diff --git a/man/ncdc_locs.Rd b/man/ncdc_locs.Rd index 29d37aea..4e93f310 100644 --- a/man/ncdc_locs.Rd +++ b/man/ncdc_locs.Rd @@ -32,13 +32,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{...}{Further named parameters, such as \code{query}, \code{path}, etc, passed on to \code{\link[httr]{modify_url}}. Unnamed parameters will be combined with @@ -48,8 +44,24 @@ an argument or store it in your .Rprofile file with an entry like A list containing metadata and the data, or a single data.frame. } \description{ -From the NOAA NCDC API docs: Locations can be a specific latitude/longitude point -such as a station, or a label representing a bounding area such as a city. +From the NOAA NCDC API docs: Locations can be a specific latitude/longitude +point such as a station, or a label representing a bounding area such as +a city. +} +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files } \examples{ \dontrun{ @@ -76,4 +88,11 @@ ncdc_locs(locationcategoryid=c('ST', 'ZIP')) ncdc_locs(locationcategoryid='CITY', sortfield='name', sortorder='desc') } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_plot}}, + \code{\link{ncdc_stations}}, \code{\link{ncdc}} +} diff --git a/man/ncdc_locs_cats.Rd b/man/ncdc_locs_cats.Rd index 02ccb24c..ca9e882e 100644 --- a/man/ncdc_locs_cats.Rd +++ b/man/ncdc_locs_cats.Rd @@ -30,13 +30,9 @@ datacoverage fields (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{...}{Further named parameters, such as \code{query}, \code{path}, etc, passed on to \code{\link[httr]{modify_url}}. Unnamed parameters will be combined with @@ -52,6 +48,21 @@ Location categories are groupings of similar locations. Locations can be a specific latitude/longitude point such as a station, or a label representing a bounding area such as a city. } +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files +} \examples{ \dontrun{ # All location categories, first 25 results @@ -70,4 +81,11 @@ ncdc_locs_cats(datasetid=c('GHCND', 'GHCNDMS')) ncdc_locs_cats(startdate='1970-01-01') } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc_stations}}, + \code{\link{ncdc}} +} diff --git a/man/ncdc_plot.Rd b/man/ncdc_plot.Rd index 13192d2b..780ddd47 100644 --- a/man/ncdc_plot.Rd +++ b/man/ncdc_plot.Rd @@ -51,4 +51,11 @@ ncdc_plot(df) ncdc_plot(out1, out2, breaks="45 days") } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_stations}}, \code{\link{ncdc}} +} diff --git a/man/ncdc_stations.Rd b/man/ncdc_stations.Rd index 3905093b..d52ef507 100644 --- a/man/ncdc_stations.Rd +++ b/man/ncdc_stations.Rd @@ -14,8 +14,8 @@ ncdc_stations(stationid = NULL, datasetid = NULL, datatypeid = NULL, \item{stationid}{A single valid station id, with datasetid namespace, e.g., GHCND:USW00014895} -\item{datasetid}{(optional) Accepts a valid dataset id or a vector or list of them. Data -returned will be from the dataset specified.} +\item{datasetid}{(optional) Accepts a valid dataset id or a vector or +list of them. Data returned will be from the dataset specified.} \item{datatypeid}{Accepts a valid data type id or a vector or list of data type ids. (optional)} @@ -49,13 +49,9 @@ search. Give four values that defines a bounding box, lat and long for the southwest corner, then lat and long for the northeast corner. For example: \code{c(minlat, minlong, maxlat, maxlong)}.} -\item{token}{This must be a valid token token supplied to you by NCDC's Climate -Data Online access token generator. (required) Get an API key (=token) at -http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as -an argument or store it in your .Rprofile file with an entry like -\itemize{ - \item options("noaakey" = "your-noaa-token") -}} +\item{token}{This must be a valid token token supplied to you by NCDC's +Climate Data Online access token generator. (required) See +\strong{Authentication} section below for more details.} \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} @@ -75,9 +71,25 @@ of the NOAA API.} A list of metadata. } \description{ -From the NOAA NCDC API docs: Stations are where the data comes from (for most datasets) -and can be considered the smallest granual of location data. If you know what -station you want, you can quickly get all manner of data from it +From the NOAA NCDC API docs: Stations are where the data comes from +(for most datasets) and can be considered the smallest granual of location +data. If you know what station you want, you can quickly get all manner of +data from it +} +\section{Authentication}{ + +Get an API key (aka, token) at \url{http://www.ncdc.noaa.gov/cdo-web/token}. +You can pass your token in as an argument or store it one of two places: + +\itemize{ + \item your .Rprofile file with an entry like + \code{options(noaakey = "your-noaa-token")} + \item your .Renviron file with an entry like + \code{NOAA_KEY=your-noaa-token} +} + +See \code{\link{Startup}} for information on how to create/find your +.Rrofile and .Renviron files } \examples{ \dontrun{ @@ -140,4 +152,11 @@ ncdc_stations(datasetid='PRECIP_HLY', startdate='19900101', enddate='19901231') ncdc_stations(extent=c(47.5204,-122.2047,47.6139,-122.1065)) } } +\seealso{ +Other ncdc: \code{\link{ncdc_combine}}, + \code{\link{ncdc_datacats}}, \code{\link{ncdc_datasets}}, + \code{\link{ncdc_datatypes}}, + \code{\link{ncdc_locs_cats}}, \code{\link{ncdc_locs}}, + \code{\link{ncdc_plot}}, \code{\link{ncdc}} +}