diff --git a/DESCRIPTION b/DESCRIPTION index 6d364f01..c678a513 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.0.0.91 +Version: 1.0.0.92 License: MIT + file LICENSE Encoding: UTF-8 Language: en-US diff --git a/R/argo.R b/R/argo.R index ff9c2f59..7d0780d7 100644 --- a/R/argo.R +++ b/R/argo.R @@ -60,13 +60,6 @@ argo_buoy_files <- function(dac, id, ...) { #' @export #' @rdname argo argo <- function(dac, id, cycle, dtype, ...) { - calls <- names(sapply(match.call(), deparse))[-1] - calls_vec <- "path" %in% calls - if (any(calls_vec)) { - stop("The parameter path has been removed, see docs for ?argo", - call. = FALSE) - } - path <- file.path(rnoaa_cache_dir(), "argo") path <- file.path(path, dac) apath <- a_local(dac, id, cycle, dtype, path) diff --git a/R/ncdc.r b/R/ncdc.r index 89af82dd..6fccba17 100644 --- a/R/ncdc.r +++ b/R/ncdc.r @@ -186,16 +186,8 @@ ncdc <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, locationid=NULL, startdate=NULL, enddate=NULL, sortfield=NULL, sortorder=NULL, limit=25, offset=NULL, - token=NULL, dataset=NULL, datatype=NULL, station=NULL, location=NULL, - locationtype=NULL, page=NULL, year=NULL, month=NULL, day=NULL, includemetadata=TRUE, - results=NULL, add_units=FALSE, ...) + token=NULL, includemetadata=TRUE, add_units=FALSE, ...) { - calls <- names(sapply(match.call(), deparse))[-1] - calls_vec <- c("dataset","datatype","station","location","locationtype","page","year","month","day","results") %in% calls - if (any(calls_vec)) { - stop("The parameters name, code, modifiedsince, startindex, and maxresults \n have been removed, and were only relavant in the old NOAA API v1. \n\nPlease see documentation for ?noaa") - } - token <- check_key(token) args <- noaa_compact(list(datasetid = datasetid, startdate = as.character(startdate), enddate = as.character(enddate), diff --git a/R/ncdc_datasets.r b/R/ncdc_datasets.r index d5c747d3..b2054366 100644 --- a/R/ncdc_datasets.r +++ b/R/ncdc_datasets.r @@ -44,22 +44,16 @@ #' ncdc_datasets(locationid=c("FIPS:30103", "FIPS:30091")) #' } -ncdc_datasets <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, locationid=NULL, - startdate=NULL, enddate=NULL, sortfield=NULL, sortorder=NULL, limit=25, offset=NULL, - token=NULL, dataset=NULL, page=NULL, year=NULL, month=NULL, ...) +ncdc_datasets <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, + locationid=NULL, startdate=NULL, enddate=NULL, sortfield=NULL, + sortorder=NULL, limit=25, offset=NULL, token=NULL, ...) { - calls <- names(sapply(match.call(), deparse))[-1] - calls_vec <- c("dataset", "page", "year", "month") %in% calls - if (any(calls_vec)) - stop("The parameters dataset, page, year, and month \n have been removed, and were only relavant in the old NOAA API v1. \n\nPlease see documentation for ?ncdc_datasets") - token <- check_key(token) - url <- paste0(ncdc_base(), "datasets") if (!is.null(datasetid)) url <- paste(url, "/", datasetid, sep = "") args <- noaa_compact(list(startdate=startdate, - enddate=enddate, sortfield=sortfield, sortorder=sortorder, - limit=limit, offset=offset)) + enddate=enddate, sortfield=sortfield, sortorder=sortorder, + limit=limit, offset=offset)) if (!is.null(stationid)) { stationid <- lapply(stationid, function(x) list(stationid = x)) } @@ -81,7 +75,8 @@ ncdc_datasets <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, locat dat <- data.frame(tt, stringsAsFactors = FALSE) all <- list(meta = NULL, data = dat) } else { - dat <- dplyr::bind_rows(lapply(tt$results, function(x) data.frame(x, stringsAsFactors = FALSE))) + dat <- dplyr::bind_rows(lapply(tt$results, function(x) + data.frame(x, stringsAsFactors = FALSE))) all <- list(meta = tt$metadata$resultset, data = dat) } } diff --git a/R/ncdc_datatypes.r b/R/ncdc_datatypes.r index f36baa37..3696eacf 100644 --- a/R/ncdc_datatypes.r +++ b/R/ncdc_datatypes.r @@ -50,14 +50,8 @@ ncdc_datatypes <- function(datasetid=NULL, datatypeid=NULL, datacategoryid=NULL, stationid=NULL, locationid=NULL, startdate=NULL, enddate=NULL, sortfield=NULL, - sortorder=NULL, limit=25, offset=NULL, token=NULL, - dataset=NULL, page=NULL, filter=NULL, ...) + sortorder=NULL, limit=25, offset=NULL, token=NULL, ...) { - calls <- names(sapply(match.call(), deparse))[-1] - calls_vec <- c("dataset", "page", "filter") %in% calls - if (any(calls_vec)) - stop("The parameters dataset, page, and filter \n have been removed, and were only relavant in the old NOAA API v1. \n\nPlease see documentation for ?ncdc_datatypes", call. = FALSE) - token <- check_key(token) if (!is.null(datatypeid)) { diff --git a/man-roxygen/argo_params.R b/man-roxygen/argo_params.R index 47e7fa6d..0b9fd152 100644 --- a/man-roxygen/argo_params.R +++ b/man-roxygen/argo_params.R @@ -100,9 +100,6 @@ #' your machine to save files to, and run #' \code{rappdirs::user_cache_dir("rnoaa/argo")} to get that directory. #' -#' The \code{path} parameter used to be used to set where files are stored -#' on your machine. -#' #' @section API Status: #' The API weas down as of 2019-11-07, and probably some time before that. The #' following functions were defunct: diff --git a/man/argo.Rd b/man/argo.Rd index 1fe6b450..52e30ee5 100644 --- a/man/argo.Rd +++ b/man/argo.Rd @@ -174,9 +174,6 @@ We use \pkg{rappdirs} to store files, see \code{\link[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/argo")} to get that directory. - -The \code{path} parameter used to be used to set where files are stored -on your machine. } \section{API Status}{ diff --git a/man/ncdc.Rd b/man/ncdc.Rd index d99e583b..ad79edf3 100644 --- a/man/ncdc.Rd +++ b/man/ncdc.Rd @@ -16,17 +16,7 @@ ncdc( limit = 25, offset = NULL, token = NULL, - dataset = NULL, - datatype = NULL, - station = NULL, - location = NULL, - locationtype = NULL, - page = NULL, - year = NULL, - month = NULL, - day = NULL, includemetadata = TRUE, - results = NULL, add_units = FALSE, ... ) @@ -67,6 +57,20 @@ Maximum is 1000 (optional)} Climate Data Online access token generator. (required) See \strong{Authentication} section below for more details.} +\item{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 of the output list called "meta" +is still returned, but is NULL. In practice, I haven't seen response +time's improve, but perhaps they will for you.} + +\item{add_units}{(logical) whether to add units information or not. +default: \code{FALSE}. If \code{TRUE}, after getting data from NOAA +we add a new column \code{units}. See "Adding units" in Details +for more} + +\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} +(optional)} + \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} \item{datatype}{THIS IS A DEPRECATED ARGUMENT. See datatypeid.} @@ -90,21 +94,7 @@ and enddate arguments.} \item{day}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate arguments.} -\item{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 of the output list called "meta" -is still returned, but is NULL. In practice, I haven't seen response -time's improve, but perhaps they will for you.} - \item{results}{THIS IS A DEPRECATED ARGUMENT. See limit.} - -\item{add_units}{(logical) whether to add units information or not. -default: \code{FALSE}. If \code{TRUE}, after getting data from NOAA -we add a new column \code{units}. See "Adding units" in Details -for more} - -\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} -(optional)} } \value{ An S3 list of length two, a slot of metadata (meta), and a slot diff --git a/man/ncdc_datasets.Rd b/man/ncdc_datasets.Rd index 5a93d57b..0f603605 100644 --- a/man/ncdc_datasets.Rd +++ b/man/ncdc_datasets.Rd @@ -16,10 +16,6 @@ ncdc_datasets( limit = 25, offset = NULL, token = NULL, - dataset = NULL, - page = NULL, - year = NULL, - month = NULL, ... ) } @@ -59,6 +55,9 @@ Maximum is 1000 (optional)} Climate Data Online access token generator. (required) See \strong{Authentication} section below for more details.} +\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} +(optional)} + \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} \item{page}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 @@ -69,9 +68,6 @@ arguments.} \item{month}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate arguments.} - -\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} -(optional)} } \value{ A data.frame for all datasets, or a list of length two, each with diff --git a/man/ncdc_datatypes.Rd b/man/ncdc_datatypes.Rd index 99c1aaed..d5246eb3 100644 --- a/man/ncdc_datatypes.Rd +++ b/man/ncdc_datatypes.Rd @@ -17,9 +17,6 @@ ncdc_datatypes( limit = 25, offset = NULL, token = NULL, - dataset = NULL, - page = NULL, - filter = NULL, ... ) } @@ -63,6 +60,9 @@ Maximum is 1000 (optional)} Climate Data Online access token generator. (required) See \strong{Authentication} section below for more details.} +\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} +(optional)} + \item{dataset}{THIS IS A DEPRECATED ARGUMENT. See datasetid.} \item{page}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 @@ -70,9 +70,6 @@ of the NOAA API.} \item{filter}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 of the NOAA API.} - -\item{...}{Curl options passed on to \code{\link[crul]{HttpClient}} -(optional)} } \value{ A \code{data.frame} for all datasets, or a list of length two,