diff --git a/DESCRIPTION b/DESCRIPTION index 4fad7450..005e1591 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.7.9190 +Version: 0.6.7.9194 License: MIT + file LICENSE Encoding: UTF-8 Authors@R: c( diff --git a/R/ncdc.r b/R/ncdc.r index 8aea74e6..d0f558a0 100644 --- a/R/ncdc.r +++ b/R/ncdc.r @@ -4,28 +4,34 @@ #' @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 -#' 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. +#' @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 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. #' #' @details -#' Note that NOAA NCDC API calls can take a long time depending on the call. The NOAA API doesn't -#' perform well with very long timespans, and will time out and make you angry - beware. -#' -#' Keep in mind that three parameters, datasetid, startdate, and enddate are required. -#' -#' Note that the default limit (no. records returned) is 25. Look at the metadata in \code{$meta} -#' to see how many records were found. If more were found than 25, you could set the parameter -#' \code{limit} to something higher than 25. -#' -#' The attributes, or "flags", for each row of the output for data may have a flag -#' with it. Each \code{datasetid} has it's own set of flags. The following are flag -#' columns, and what they stand for. \code{fl_} is the beginning of each flag -#' column name, then one or more characters to describe the flag, keeping it short -#' to maintain a compact data frame. Some of these fields are the same across -#' datasetids. See the vignette \code{vignette("rnoaa_attributes", "rnoaa")} for +#' Note that NOAA NCDC API calls can take a long time depending on the call. +#' The NOAA API doesn't perform well with very long timespans, and will +#' time out and make you angry - beware. +#' +#' Keep in mind that three parameters, datasetid, startdate, and enddate +#' are required. +#' +#' Note that the default limit (no. records returned) is 25. Look at the +#' metadata in \code{$meta} to see how many records were found. If more were +#' found than 25, you could set the parameter \code{limit} to +#' something higher than 25. +#' +#' The attributes, or "flags", for each row of the output for data may have +#' a flag with it. Each \code{datasetid} has it's own set of flags. The +#' following are flag columns, and what they stand for. \code{fl_} is the +#' beginning of each flag column name, then one or more characters to describe +#' the flag, keeping it short to maintain a compact data frame. Some of +#' these fields are the same across datasetids. See the vignette +#' \code{vignette("rnoaa_attributes", "rnoaa")} for #' description of possible values for each flag. #' #' \itemize{ @@ -40,16 +46,16 @@ #' \item fl_u units #' } #' -#' @return An S3 list of length two, a slot of metadata (meta), and a slot for data (data). -#' 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. +#' @return An S3 list of length two, a slot of metadata (meta), and a slot +#' for data (data). 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', -#' enddate = '2013-12-01') +#' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', +#' startdate = '2013-10-01', enddate = '2013-12-01') #' #' # GHCND data, for a location by FIPS code #' ncdc(datasetid='GHCND', locationid = 'FIPS:02', startdate = '2010-05-01', @@ -58,15 +64,18 @@ #' # GHCND data from October 1 2013 to December 1 2013 #' ncdc(datasetid='GHCND', startdate = '2013-10-01', enddate = '2013-10-05') #' -#' # GHCN-Monthly (or GHCNDMS) data from October 1 2013 to December 1 2013 -#' ncdc(datasetid='GHCNDMS', startdate = '2013-10-01', enddate = '2013-12-01') +#' # GHCN-Monthly (or GSOM) data from October 1 2013 to December 1 2013 +#' ncdc(datasetid='GSOM', startdate = '2013-10-01', enddate = '2013-12-01') +#' ncdc(datasetid='GSOM', startdate = '2013-10-01', enddate = '2013-12-01', +#' stationid = "GHCND:AE000041196") #' #' # Normals Daily (or NORMAL_DLY) GHCND:USW00014895 dly-tmax-normal data -#' ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', startdate = '2010-05-01', -#' enddate = '2010-05-10') +#' ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', +#' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Dataset, and location in Australia -#' ncdc(datasetid='GHCND', locationid='FIPS:AS', startdate = '2010-05-01', enddate = '2010-05-31') +#' ncdc(datasetid='GHCND', locationid='FIPS:AS', startdate = '2010-05-01', +#' enddate = '2010-05-31') #' #' # Dataset, location and datatype for PRECIP_HLY data #' ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', datatypeid='HPCP', @@ -81,19 +90,21 @@ #' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Dataset, location, station and datatype -#' ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', stationid='COOP:310301', datatypeid='HPCP', +#' ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', +#' stationid='COOP:310301', datatypeid='HPCP', #' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Dataset, location, and datatype for GHCND -#' ncdc(datasetid='GHCND', locationid='FIPS:BR', datatypeid='PRCP', startdate = '2010-05-01', -#' enddate = '2010-05-10') +#' ncdc(datasetid='GHCND', locationid='FIPS:BR', datatypeid='PRCP', +#' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Normals Daily GHCND dly-tmax-normal data -#' ncdc(datasetid='NORMAL_DLY', datatypeid='dly-tmax-normal', startdate = '2010-05-01', -#' enddate = '2010-05-10') +#' ncdc(datasetid='NORMAL_DLY', datatypeid='dly-tmax-normal', +#' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Normals Daily GHCND:USW00014895 dly-tmax-normal -#' ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', datatypeid='dly-tmax-normal', +#' ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', +#' datatypeid='dly-tmax-normal', #' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # Hourly Precipitation data for ZIP code 28801 @@ -101,32 +112,33 @@ #' startdate = '2010-05-01', enddate = '2010-05-10') #' #' # 15 min Precipitation data for ZIP code 28801 -#' ncdc(datasetid='PRECIP_15', datatypeid='QPCP', startdate = '2010-05-01', enddate = '2010-05-02') +#' ncdc(datasetid='PRECIP_15', datatypeid='QPCP', +#' startdate = '2010-05-01', enddate = '2010-05-02') #' #' # Search the NORMAL_HLY dataset -#' ncdc(datasetid='NORMAL_HLY', stationid = 'GHCND:USW00003812', startdate = '2010-05-01', -#' enddate = '2010-05-10') +#' ncdc(datasetid='NORMAL_HLY', stationid = 'GHCND:USW00003812', +#' startdate = '2010-05-01', enddate = '2010-05-10') #' -#' # Search the ANNUAL dataset +#' # Search the GSOY dataset #' ncdc(datasetid='ANNUAL', locationid='ZIP:28801', startdate = '2010-05-01', #' enddate = '2010-05-10') #' #' # Search the NORMAL_ANN dataset -#' ncdc(datasetid='NORMAL_ANN', datatypeid='ANN-DUTR-NORMAL', startdate = '2010-01-01', -#' enddate = '2010-01-01') +#' ncdc(datasetid='NORMAL_ANN', datatypeid='ANN-DUTR-NORMAL', +#' startdate = '2010-01-01', enddate = '2010-01-01') #' #' # Include metadata or not -#' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', -#' enddate = '2013-12-01') -#' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', -#' enddate = '2013-12-01', includemetadata=FALSE) +#' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', +#' startdate = '2013-10-01', enddate = '2013-12-01') +#' ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', +#' startdate = '2013-10-01', enddate = '2013-12-01', includemetadata=FALSE) #' #' # Many stationid's #' stat <- ncdc_stations(startdate = "2000-01-01", enddate = "2016-01-01") #' ## find out what datasets might be available for these stations #' ncdc_datasets(stationid = stat$data$id[1]) #' ## get some data -#' ncdc(datasetid = "ANNUAL", stationid = stat$data$id[1:10], +#' ncdc(datasetid = "GSOY", stationid = stat$data$id[1:10], #' startdate = "2010-01-01", enddate = "2011-01-01") #' } #' @@ -144,13 +156,15 @@ ncdc <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, locationid=NUL { 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)) + 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=startdate, - enddate=enddate, sortfield=sortfield, sortorder=sortorder, - limit=limit, offset=offset, includemetadata=includemetadata)) + args <- noaa_compact(list(datasetid = datasetid, startdate = startdate, + enddate = enddate, sortfield = sortfield, + sortorder = sortorder, limit = limit, + offset = offset, includemetadata = includemetadata)) if (!is.null(stationid)) { stationid <- lapply(stationid, function(x) list(stationid = x)) } @@ -164,36 +178,43 @@ ncdc <- function(datasetid=NULL, datatypeid=NULL, stationid=NULL, locationid=NUL args <- as.list(unlist(args)) names(args) <- gsub("[0-9]+", "", names(args)) if (length(args) == 0) args <- NULL - temp <- GET(paste0(ncdc_base(), "data"), query=args, add_headers("token" = token), ...) + temp <- GET(paste0(ncdc_base(), "data"), query = args, + add_headers("token" = token), ...) tt <- check_response(temp) - if(inherits(tt, "character")){ - all <- list(meta=NA, data=NA) + if (inherits(tt, "character")) { + all <- list(meta = NA, data = NA) } else { - tt$results <- lapply(tt$results, split_atts, ds=datasetid) - dat <- dplyr::bind_rows(lapply(tt$results, function(x) data.frame(x,stringsAsFactors=FALSE))) + tt$results <- lapply(tt$results, split_atts, ds = datasetid) + dat <- dplyr::bind_rows(lapply(tt$results, function(x) + data.frame(x,stringsAsFactors = FALSE))) meta <- tt$metadata$resultset - atts <- list(totalCount=meta$count, pageCount=meta$limit, offset=meta$offset) - all <- list(meta=atts, data=dat) + atts <- list(totalCount = meta$count, pageCount = meta$limit, + offset = meta$offset) + all <- list(meta = atts, data = dat) } - structure(all, class="ncdc_data") + structure(all, class = "ncdc_data") } -split_atts <- function(x, ds="GHCNDMS"){ +split_atts <- function(x, ds = "GSOM"){ tmp <- x$attributes out <- switch(ds, - ANNUAL = parse_ncdc(tmp,c('fl_m','fl_q','fl_d','fl_u')), - GHCND = parse_ncdc(tmp,c('fl_m','fl_q','fl_so','fl_t')), - GHCNDMS = parse_ncdc(tmp,c('fl_miss','fl_cmiss')), - NEXRAD2 = parse_ncdc(tmp,c('x','x')), # no data returned, fix when data returned - NEXRAD3 = parse_ncdc(tmp,c('x','x')), # no data returned, fix when data returned - NORMAL_ANN = parse_ncdc(tmp,'fl_c'), - NORMAL_DLY = parse_ncdc(tmp,'fl_c'), - NORMAL_HLY = parse_ncdc(tmp,'fl_c'), - NORMAL_MLY = parse_ncdc(tmp,'fl_c'), - PRECIP_15 = parse_ncdc(tmp,c('fl_m','fl_q','fl_u')), - PRECIP_HLY = parse_ncdc(tmp,c('fl_m','fl_q'))) - notatts <- x[!names(x)=="attributes"] + GHCND = parse_ncdc(tmp, c('fl_m','fl_q','fl_so','fl_t')), + # leave in duplicate for now + GHCNDMS = parse_ncdc(tmp, c('fl_miss','fl_cmiss')), + GSOM = parse_ncdc(tmp, c('fl_miss','fl_cmiss')), + # leave in duplicate for now + ANNUAL = parse_ncdc(tmp, c('fl_m','fl_q','fl_d','fl_u')), + GSOY = parse_ncdc(tmp, c('fl_m','fl_q','fl_d','fl_u')), + NEXRAD2 = parse_ncdc(tmp, c('x','x')), # no data returned, fix when data returned + NEXRAD3 = parse_ncdc(tmp, c('x','x')), # no data returned, fix when data returned + NORMAL_ANN = parse_ncdc(tmp, 'fl_c'), + NORMAL_DLY = parse_ncdc(tmp, 'fl_c'), + NORMAL_HLY = parse_ncdc(tmp, 'fl_c'), + NORMAL_MLY = parse_ncdc(tmp, 'fl_c'), + PRECIP_15 = parse_ncdc(tmp, c('fl_m','fl_q','fl_u')), + PRECIP_HLY = parse_ncdc(tmp, c('fl_m','fl_q'))) + notatts <- x[!names(x) == "attributes"] c(notatts, out) } diff --git a/R/ncdc_datasets.r b/R/ncdc_datasets.r index 4294d115..ab99ac3d 100644 --- a/R/ncdc_datasets.r +++ b/R/ncdc_datasets.r @@ -37,6 +37,7 @@ #' # Multiple datatypeid's #' ncdc_datasets(datatypeid=c('ACMC','ACMH','ACSC')) #' ncdc_datasets(datasetid='ANNUAL', datatypeid=c('ACMC','ACMH','ACSC')) +#' ncdc_datasets(datasetid='GSOY', datatypeid=c('ACMC','ACMH','ACSC')) #' #' # Multiple locationid's #' ncdc_datasets(locationid="FIPS:30091") diff --git a/R/ncdc_datatypes.r b/R/ncdc_datatypes.r index 53d33286..04e46d08 100644 --- a/R/ncdc_datatypes.r +++ b/R/ncdc_datatypes.r @@ -29,7 +29,10 @@ #' ncdc_datatypes(datatypeid="ACSC") #' #' # datasetid, one or many +#' ## ANNUAL should be replaced by GSOY, but both exist and give +#' ## different answers #' ncdc_datatypes(datasetid="ANNUAL") +#' ncdc_datatypes(datasetid="GSOY") #' ncdc_datatypes(datasetid=c("ANNUAL", "PRECIP_HLY")) #' #' # Fetch data types with the air temperature data category diff --git a/R/ncdc_locs.r b/R/ncdc_locs.r index b70bac00..ef5c7d22 100644 --- a/R/ncdc_locs.r +++ b/R/ncdc_locs.r @@ -22,7 +22,8 @@ #' # Fetch available locations for the GHCND (Daily Summaries) dataset #' ncdc_locs(datasetid='GHCND') #' ncdc_locs(datasetid=c('GHCND', 'ANNUAL')) -#' ncdc_locs(datasetid=c('GHCND', 'GHCNDMS')) +#' ncdc_locs(datasetid=c('GSOY', 'ANNUAL')) +#' ncdc_locs(datasetid=c('GHCND', 'GSOM')) #' #' # Fetch all U.S. States #' ncdc_locs(locationcategoryid='ST', limit=52) diff --git a/R/ncdc_locs_cats.r b/R/ncdc_locs_cats.r index ed572586..a250e442 100644 --- a/R/ncdc_locs_cats.r +++ b/R/ncdc_locs_cats.r @@ -21,9 +21,11 @@ #' #' # Displays available location categories within GHCN-Daily dataset #' ncdc_locs_cats(datasetid='GHCND') +#' ncdc_locs_cats(datasetid='GSOY') +#' ncdc_locs_cats(datasetid='ANNUAL') #' #' # multiple datasetid's -#' ncdc_locs_cats(datasetid=c('GHCND', 'GHCNDMS')) +#' ncdc_locs_cats(datasetid=c('GHCND', 'GSOM')) #' #' # Displays available location categories from start date 1970-01-01 #' ncdc_locs_cats(startdate='1970-01-01') diff --git a/R/ncdc_stations.r b/R/ncdc_stations.r index 9b7b909f..7696e36e 100644 --- a/R/ncdc_stations.r +++ b/R/ncdc_stations.r @@ -35,8 +35,9 @@ #' }$data) #' #' # Displays all stations within GHCN-Daily (100 Stations per page limit) -#' ncdc_stations(datasetid='GHCND') -#' ncdc_stations(datasetid=c('GHCND', 'ANNUAL')) +#' ncdc_stations(datasetid = 'GHCND') +#' ncdc_stations(datasetid = 'ANNUAL') +#' ncdc_stations(datasetid = 'GSOY') #' #' # Station #' ncdc_stations(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895') diff --git a/README.md b/README.md index 8695a9e8..cc3cb51c 100644 --- a/README.md +++ b/README.md @@ -51,18 +51,16 @@ Functions to work with buoy data use netcdf files. You'll need the `ncdf` packag ## NOAA NCDC Datasets -There are many NOAA NCDC datasets. All data sources work, except `NEXRAD2` and `NEXRAD3`, for an unkown reason. This relates to `ncdc_*()` functions only. +There are many NOAA NCDC datasets. All data sources work, except `NEXRAD2` and `NEXRAD3`, for an unknown reason. This relates to `ncdc_*()` functions only. |Dataset |Description |Start Date |End Date | Data Coverage| |:----------|:---------------------------|:----------|:----------|-------------:| -|ANNUAL |Annual Summaries |1831-02-01 |2015-11-01 | 1.00| -|GHCND |Daily Summaries |1763-01-01 |2016-08-21 | 1.00| -|GHCNDMS |Monthly Summaries |1763-01-01 |2016-03-01 | 1.00| -|GSOM |Global Summary of the Month |1763-01-01 |2016-07-01 | 1.00| +|GHCND |Daily Summaries |1763-01-01 |2017-02-14 | 1.00| +|GSOM |Global Summary of the Month |1763-01-01 |2016-11-01 | 1.00| |GSOY |Global Summary of the Year |1763-01-01 |2016-01-01 | 1.00| -|NEXRAD2 |Weather Radar (Level II) |1991-06-05 |2016-08-22 | 0.95| -|NEXRAD3 |Weather Radar (Level III) |1994-05-20 |2016-08-19 | 0.95| +|NEXRAD2 |Weather Radar (Level II) |1991-06-05 |2017-02-14 | 0.95| +|NEXRAD3 |Weather Radar (Level III) |1994-05-20 |2017-02-10 | 0.95| |NORMAL_ANN |Normals Annual/Seasonal |2010-01-01 |2010-01-01 | 1.00| |NORMAL_DLY |Normals Daily |2010-01-01 |2010-12-31 | 1.00| |NORMAL_HLY |Normals Hourly |2010-01-01 |2010-12-31 | 1.00| @@ -157,31 +155,31 @@ ncdc_locs(locationcategoryid='CITY', sortfield='name', sortorder='desc') #> #> $data #> mindate maxdate name datacoverage id -#> 1 1892-08-01 2016-07-31 Zwolle, NL 1.0000 CITY:NL000012 -#> 2 1901-01-01 2016-08-19 Zurich, SZ 1.0000 CITY:SZ000007 -#> 3 1957-07-01 2016-08-19 Zonguldak, TU 1.0000 CITY:TU000057 -#> 4 1906-01-01 2016-08-19 Zinder, NG 0.9025 CITY:NG000004 -#> 5 1973-01-01 2016-08-19 Ziguinchor, SG 1.0000 CITY:SG000004 -#> 6 1938-01-01 2016-08-19 Zhytomyra, UP 0.9723 CITY:UP000025 -#> 7 1948-03-01 2016-08-19 Zhezkazgan, KZ 0.9302 CITY:KZ000017 -#> 8 1951-01-01 2016-08-19 Zhengzhou, CH 1.0000 CITY:CH000045 -#> 9 1941-01-01 2016-07-31 Zaragoza, SP 1.0000 CITY:SP000021 +#> 1 1892-08-01 2016-12-31 Zwolle, NL 1.0000 CITY:NL000012 +#> 2 1901-01-01 2017-02-08 Zurich, SZ 1.0000 CITY:SZ000007 +#> 3 1957-07-01 2017-02-07 Zonguldak, TU 1.0000 CITY:TU000057 +#> 4 1906-01-01 2017-02-08 Zinder, NG 0.9025 CITY:NG000004 +#> 5 1973-01-01 2017-02-07 Ziguinchor, SG 1.0000 CITY:SG000004 +#> 6 1938-01-01 2017-02-08 Zhytomyra, UP 0.9723 CITY:UP000025 +#> 7 1948-03-01 2017-02-08 Zhezkazgan, KZ 0.9302 CITY:KZ000017 +#> 8 1951-01-01 2017-02-08 Zhengzhou, CH 1.0000 CITY:CH000045 +#> 9 1941-01-01 2016-12-31 Zaragoza, SP 1.0000 CITY:SP000021 #> 10 1936-01-01 2009-06-17 Zaporiyhzhya, UP 1.0000 CITY:UP000024 -#> 11 1957-01-01 2016-08-19 Zanzibar, TZ 0.8016 CITY:TZ000019 -#> 12 1973-01-01 2016-08-19 Zanjan, IR 0.9105 CITY:IR000020 -#> 13 1893-01-01 2016-08-22 Zanesville, OH US 1.0000 CITY:US390029 -#> 14 1912-01-01 2016-08-19 Zahle, LE 0.9819 CITY:LE000004 -#> 15 1951-01-01 2016-08-19 Zahedan, IR 0.9975 CITY:IR000019 -#> 16 1860-12-01 2016-08-19 Zagreb, HR 1.0000 CITY:HR000002 -#> 17 1975-08-29 2016-08-19 Zacatecas, MX 0.9993 CITY:MX000036 -#> 18 1947-01-01 2016-08-19 Yuzhno-Sakhalinsk, RS 1.0000 CITY:RS000081 -#> 19 1893-01-01 2016-08-22 Yuma, AZ US 1.0000 CITY:US040015 -#> 20 1942-02-01 2016-08-22 Yucca Valley, CA US 1.0000 CITY:US060048 -#> 21 1885-01-01 2016-08-22 Yuba City, CA US 1.0000 CITY:US060047 -#> 22 1998-02-01 2016-08-19 Yozgat, TU 1.0000 CITY:TU000056 -#> 23 1893-01-01 2016-08-22 Youngstown, OH US 1.0000 CITY:US390028 -#> 24 1894-01-01 2016-08-22 York, PA US 1.0000 CITY:US420024 -#> 25 1876-01-01 2016-08-22 Yonkers, NY US 1.0000 CITY:US360031 +#> 11 1957-01-01 2017-02-10 Zanzibar, TZ 0.8016 CITY:TZ000019 +#> 12 1973-01-01 2017-02-08 Zanjan, IR 0.9105 CITY:IR000020 +#> 13 1893-01-01 2017-02-14 Zanesville, OH US 1.0000 CITY:US390029 +#> 14 1912-01-01 2017-02-07 Zahle, LE 0.9819 CITY:LE000004 +#> 15 1951-01-01 2017-02-08 Zahedan, IR 0.9975 CITY:IR000019 +#> 16 1860-12-01 2017-02-08 Zagreb, HR 1.0000 CITY:HR000002 +#> 17 1975-08-29 2017-02-08 Zacatecas, MX 0.9993 CITY:MX000036 +#> 18 1947-01-01 2017-02-08 Yuzhno-Sakhalinsk, RS 1.0000 CITY:RS000081 +#> 19 1893-01-01 2017-02-14 Yuma, AZ US 1.0000 CITY:US040015 +#> 20 1942-02-01 2017-02-14 Yucca Valley, CA US 1.0000 CITY:US060048 +#> 21 1885-01-01 2017-02-14 Yuba City, CA US 1.0000 CITY:US060047 +#> 22 1998-02-01 2017-02-08 Yozgat, TU 1.0000 CITY:TU000056 +#> 23 1893-01-01 2017-02-14 Youngstown, OH US 1.0000 CITY:US390028 +#> 24 1894-01-01 2017-02-14 York, PA US 1.0000 CITY:US420024 +#> 25 1876-01-01 2017-02-14 Yonkers, NY US 1.0000 CITY:US360031 #> #> attr(,"class") #> [1] "ncdc_locs" @@ -197,7 +195,7 @@ ncdc_stations(datasetid='GHCND', locationid='FIPS:12017', stationid='GHCND:USC00 #> #> $data #> elevation mindate maxdate latitude name -#> 1 12.2 1899-02-01 2016-08-20 28.8029 INVERNESS 3 SE, FL US +#> 1 12.2 1899-02-01 2017-02-13 28.8029 INVERNESS 3 SE, FL US #> datacoverage id elevationUnit longitude #> 1 1 GHCND:USC00084289 METERS -82.3126 #> @@ -260,7 +258,7 @@ ncdc_datasets() #> [1] 1 #> #> $meta$count -#> [1] 13 +#> [1] 11 #> #> $meta$limit #> [1] 25 @@ -268,33 +266,29 @@ ncdc_datasets() #> #> $data #> uid mindate maxdate name -#> 1 gov.noaa.ncdc:C00040 1831-02-01 2015-11-01 Annual Summaries -#> 2 gov.noaa.ncdc:C00861 1763-01-01 2016-08-21 Daily Summaries -#> 3 gov.noaa.ncdc:C00841 1763-01-01 2016-03-01 Monthly Summaries -#> 4 gov.noaa.ncdc:C00946 1763-01-01 2016-07-01 Global Summary of the Month -#> 5 gov.noaa.ncdc:C00947 1763-01-01 2016-01-01 Global Summary of the Year -#> 6 gov.noaa.ncdc:C00345 1991-06-05 2016-08-22 Weather Radar (Level II) -#> 7 gov.noaa.ncdc:C00708 1994-05-20 2016-08-19 Weather Radar (Level III) -#> 8 gov.noaa.ncdc:C00821 2010-01-01 2010-01-01 Normals Annual/Seasonal -#> 9 gov.noaa.ncdc:C00823 2010-01-01 2010-12-31 Normals Daily -#> 10 gov.noaa.ncdc:C00824 2010-01-01 2010-12-31 Normals Hourly -#> 11 gov.noaa.ncdc:C00822 2010-01-01 2010-12-01 Normals Monthly -#> 12 gov.noaa.ncdc:C00505 1970-05-12 2014-01-01 Precipitation 15 Minute -#> 13 gov.noaa.ncdc:C00313 1900-01-01 2014-01-01 Precipitation Hourly +#> 1 gov.noaa.ncdc:C00861 1763-01-01 2017-02-14 Daily Summaries +#> 2 gov.noaa.ncdc:C00946 1763-01-01 2016-11-01 Global Summary of the Month +#> 3 gov.noaa.ncdc:C00947 1763-01-01 2016-01-01 Global Summary of the Year +#> 4 gov.noaa.ncdc:C00345 1991-06-05 2017-02-14 Weather Radar (Level II) +#> 5 gov.noaa.ncdc:C00708 1994-05-20 2017-02-10 Weather Radar (Level III) +#> 6 gov.noaa.ncdc:C00821 2010-01-01 2010-01-01 Normals Annual/Seasonal +#> 7 gov.noaa.ncdc:C00823 2010-01-01 2010-12-31 Normals Daily +#> 8 gov.noaa.ncdc:C00824 2010-01-01 2010-12-31 Normals Hourly +#> 9 gov.noaa.ncdc:C00822 2010-01-01 2010-12-01 Normals Monthly +#> 10 gov.noaa.ncdc:C00505 1970-05-12 2014-01-01 Precipitation 15 Minute +#> 11 gov.noaa.ncdc:C00313 1900-01-01 2014-01-01 Precipitation Hourly #> datacoverage id -#> 1 1.00 ANNUAL -#> 2 1.00 GHCND -#> 3 1.00 GHCNDMS -#> 4 1.00 GSOM -#> 5 1.00 GSOY -#> 6 0.95 NEXRAD2 -#> 7 0.95 NEXRAD3 -#> 8 1.00 NORMAL_ANN -#> 9 1.00 NORMAL_DLY -#> 10 1.00 NORMAL_HLY -#> 11 1.00 NORMAL_MLY -#> 12 0.25 PRECIP_15 -#> 13 1.00 PRECIP_HLY +#> 1 1.00 GHCND +#> 2 1.00 GSOM +#> 3 1.00 GSOY +#> 4 0.95 NEXRAD2 +#> 5 0.95 NEXRAD3 +#> 6 1.00 NORMAL_ANN +#> 7 1.00 NORMAL_DLY +#> 8 1.00 NORMAL_HLY +#> 9 1.00 NORMAL_MLY +#> 10 0.25 PRECIP_15 +#> 11 1.00 PRECIP_HLY #> #> attr(,"class") #> [1] "ncdc_datasets" @@ -402,26 +396,26 @@ Get storm data for the year 2010 ```r storm_data(year = 2010) -#> -#> Size: 2855 X 195 -#> -#> serial_num season num basin sub_basin name iso_time -#> 1 2009317S10073 2010 1 SI MM ANJA 2009-11-13 06:00:00 -#> 2 2009317S10073 2010 1 SI MM ANJA 2009-11-13 12:00:00 -#> 3 2009317S10073 2010 1 SI MM ANJA 2009-11-13 18:00:00 -#> 4 2009317S10073 2010 1 SI MM ANJA 2009-11-14 00:00:00 -#> 5 2009317S10073 2010 1 SI MM ANJA 2009-11-14 06:00:00 -#> 6 2009317S10073 2010 1 SI MM ANJA 2009-11-14 12:00:00 -#> 7 2009317S10073 2010 1 SI MM ANJA 2009-11-14 18:00:00 -#> 8 2009317S10073 2010 1 SI MM ANJA 2009-11-15 00:00:00 -#> 9 2009317S10073 2010 1 SI MM ANJA 2009-11-15 06:00:00 -#> 10 2009317S10073 2010 1 SI MM ANJA 2009-11-15 12:00:00 -#> .. ... ... ... ... ... ... ... -#> Variables not shown: nature (chr), latitude (dbl), longitude (dbl), -#> wind.wmo. (dbl), pres.wmo. (dbl), center (chr), wind.wmo..percentile -#> (dbl), pres.wmo..percentile (dbl), track_type (chr), -#> latitude_for_mapping (dbl), longitude_for_mapping (dbl), -#> current.basin (chr), hurdat_atl_lat (dbl), hurdat_atl_lon (dbl), +#> # A tibble: 2,855 × 195 +#> serial_num season num basin sub_basin name iso_time +#> +#> 1 2009317S10073 2010 1 SI MM ANJA 2009-11-13 06:00:00 +#> 2 2009317S10073 2010 1 SI MM ANJA 2009-11-13 12:00:00 +#> 3 2009317S10073 2010 1 SI MM ANJA 2009-11-13 18:00:00 +#> 4 2009317S10073 2010 1 SI MM ANJA 2009-11-14 00:00:00 +#> 5 2009317S10073 2010 1 SI MM ANJA 2009-11-14 06:00:00 +#> 6 2009317S10073 2010 1 SI MM ANJA 2009-11-14 12:00:00 +#> 7 2009317S10073 2010 1 SI MM ANJA 2009-11-14 18:00:00 +#> 8 2009317S10073 2010 1 SI MM ANJA 2009-11-15 00:00:00 +#> 9 2009317S10073 2010 1 SI MM ANJA 2009-11-15 06:00:00 +#> 10 2009317S10073 2010 1 SI MM ANJA 2009-11-15 12:00:00 +#> # ... with 2,845 more rows, and 188 more variables: nature , +#> # latitude , longitude , wind.wmo. , pres.wmo. , +#> # center , wind.wmo..percentile , pres.wmo..percentile , +#> # track_type , latitude_for_mapping , +#> # longitude_for_mapping , current.basin , +#> # hurdat_atl_lat , hurdat_atl_lon , hurdat_atl_grade , +#> # hurdat_atl_wind , hurdat_atl_pres , td9636_lat , ... ``` @@ -508,4 +502,4 @@ coops_search(station_name = 9063053, begin_date = 20150927, end_date = 20150928, * Get citation information for `rnoaa` in R doing `citation(package = 'rnoaa')` * Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. -[![rofooter](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) +[![rofooter](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org) diff --git a/inst/img/unnamed-chunk-13-1.png b/inst/img/unnamed-chunk-13-1.png index 1d1ec179..3b93d7c3 100644 Binary files a/inst/img/unnamed-chunk-13-1.png and b/inst/img/unnamed-chunk-13-1.png differ diff --git a/inst/img/unnamed-chunk-14-1.png b/inst/img/unnamed-chunk-14-1.png index 0b7ea629..8c3a4cef 100644 Binary files a/inst/img/unnamed-chunk-14-1.png and b/inst/img/unnamed-chunk-14-1.png differ diff --git a/inst/vign/ncdc_attributes.Rmd b/inst/vign/ncdc_attributes.Rmd index fd2243c9..9fd83894 100644 --- a/inst/vign/ncdc_attributes.Rmd +++ b/inst/vign/ncdc_attributes.Rmd @@ -26,9 +26,9 @@ below details on each dataset. __Datasets__ -* [ANNUAL](#annual) * [GHCND](#ghcnd) -* [GHCNDMS](#ghcndms) +* [GSOM](#gsom) +* [GSOY](#gsoy) * [NORMAL_ANN](#normalann) * [NORMAL_DLY](#normaldly) * [NORMAL_HLY](#normalhly) @@ -38,60 +38,6 @@ __Datasets__ * NEXRAD2 - not working yet * NEXRAD3 - not working yet -### # Dataset: ANNUAL - -__More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf) - -#### fl_m (Measurement flag) - -* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months -(TPCP). -* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. -(CLDD, HTDD) -* __E:__ An estimated monthly or annual total. -* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, -MMXT, MNTM, TPCP, TSNW) -* __M:__ used to indicate data element missing. -* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a -__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. -* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". -(EMXP, MXSD, TPCP, TSNW) -* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day -of occurrence. -* __Blank:__ No report - -#### fl_q (Quality flag) - -* __A:__ Accumulated amount -* __E:__ Estimated value -* __+:__ Value occurred on more than one day, last date of occurrence is used - -#### fl_d (Number of days flag ) - -Number of days is given as 00 when all days in the month are considered in -computing data value or otherwise the maximum number of consecutive days in the month considered -in computing the data value. - -#### fl_u (Units flag) - -* __C:__ Whole degree Celsius -* __D:__ Whole Fahrenheit Degree Day -* __F:__ Whole degree Fahrenheit -* __HI:__ Hundredths of inches -* __I:__ Whole inches -* __M:__ Whole miles -* __MH:__ Miles per hour -* __MM:__ Millimeters -* __NA:__ No units applicable (dimensionless) -* __TC:__ Tenths of degrees Celsius -* __TF:__ Tenths of degrees Fahrenheit -* __TI:__ Tenths of inches -* __TM:__ Tenths of millimeters -* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths -* __2:__ Soils, degrees Celsius, soil depth in whole centimeters -* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths -* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters -* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. ### # Dataset: GHCND @@ -159,7 +105,11 @@ in computing the data value. Is the (2 digit hour, 2 digit minute) 24 hour clock time of the observation given as the local time at the station of record. -### # Dataset: GHCNDMS + + +### # Dataset: GSOM + +__More info:__ Observations are synonymous with elements or values, and defined in Table A below. 9999 indicates missing data or data that has not been received. @@ -174,6 +124,64 @@ Defined as total number of days observation/element is missing in that month. Th Defined as the maximum number of consecutive days in the month that an observation/element is missing. + +### # Dataset: GSOY + +__More info:__ + +#### fl_m (Measurement flag) + +* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months +(TPCP). +* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. +(CLDD, HTDD) +* __E:__ An estimated monthly or annual total. +* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, +MMXT, MNTM, TPCP, TSNW) +* __M:__ used to indicate data element missing. +* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a +__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. +* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". +(EMXP, MXSD, TPCP, TSNW) +* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day +of occurrence. +* __Blank:__ No report + +#### fl_q (Quality flag) + +* __A:__ Accumulated amount +* __E:__ Estimated value +* __+:__ Value occurred on more than one day, last date of occurrence is used + +#### fl_d (Number of days flag ) + +Number of days is given as 00 when all days in the month are considered in +computing data value or otherwise the maximum number of consecutive days in the month considered +in computing the data value. + +#### fl_u (Units flag) + +* __C:__ Whole degree Celsius +* __D:__ Whole Fahrenheit Degree Day +* __F:__ Whole degree Fahrenheit +* __HI:__ Hundredths of inches +* __I:__ Whole inches +* __M:__ Whole miles +* __MH:__ Miles per hour +* __MM:__ Millimeters +* __NA:__ No units applicable (dimensionless) +* __TC:__ Tenths of degrees Celsius +* __TF:__ Tenths of degrees Fahrenheit +* __TI:__ Tenths of inches +* __TM:__ Tenths of millimeters +* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths +* __2:__ Soils, degrees Celsius, soil depth in whole centimeters +* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths +* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters +* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. + + + ### # Dataset: NORMAL_ANN __More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf) diff --git a/inst/vign/ncdc_attributes.md b/inst/vign/ncdc_attributes.md index fd2243c9..9fd83894 100644 --- a/inst/vign/ncdc_attributes.md +++ b/inst/vign/ncdc_attributes.md @@ -26,9 +26,9 @@ below details on each dataset. __Datasets__ -* [ANNUAL](#annual) * [GHCND](#ghcnd) -* [GHCNDMS](#ghcndms) +* [GSOM](#gsom) +* [GSOY](#gsoy) * [NORMAL_ANN](#normalann) * [NORMAL_DLY](#normaldly) * [NORMAL_HLY](#normalhly) @@ -38,60 +38,6 @@ __Datasets__ * NEXRAD2 - not working yet * NEXRAD3 - not working yet -### # Dataset: ANNUAL - -__More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf) - -#### fl_m (Measurement flag) - -* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months -(TPCP). -* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. -(CLDD, HTDD) -* __E:__ An estimated monthly or annual total. -* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, -MMXT, MNTM, TPCP, TSNW) -* __M:__ used to indicate data element missing. -* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a -__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. -* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". -(EMXP, MXSD, TPCP, TSNW) -* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day -of occurrence. -* __Blank:__ No report - -#### fl_q (Quality flag) - -* __A:__ Accumulated amount -* __E:__ Estimated value -* __+:__ Value occurred on more than one day, last date of occurrence is used - -#### fl_d (Number of days flag ) - -Number of days is given as 00 when all days in the month are considered in -computing data value or otherwise the maximum number of consecutive days in the month considered -in computing the data value. - -#### fl_u (Units flag) - -* __C:__ Whole degree Celsius -* __D:__ Whole Fahrenheit Degree Day -* __F:__ Whole degree Fahrenheit -* __HI:__ Hundredths of inches -* __I:__ Whole inches -* __M:__ Whole miles -* __MH:__ Miles per hour -* __MM:__ Millimeters -* __NA:__ No units applicable (dimensionless) -* __TC:__ Tenths of degrees Celsius -* __TF:__ Tenths of degrees Fahrenheit -* __TI:__ Tenths of inches -* __TM:__ Tenths of millimeters -* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths -* __2:__ Soils, degrees Celsius, soil depth in whole centimeters -* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths -* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters -* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. ### # Dataset: GHCND @@ -159,7 +105,11 @@ in computing the data value. Is the (2 digit hour, 2 digit minute) 24 hour clock time of the observation given as the local time at the station of record. -### # Dataset: GHCNDMS + + +### # Dataset: GSOM + +__More info:__ Observations are synonymous with elements or values, and defined in Table A below. 9999 indicates missing data or data that has not been received. @@ -174,6 +124,64 @@ Defined as total number of days observation/element is missing in that month. Th Defined as the maximum number of consecutive days in the month that an observation/element is missing. + +### # Dataset: GSOY + +__More info:__ + +#### fl_m (Measurement flag) + +* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months +(TPCP). +* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. +(CLDD, HTDD) +* __E:__ An estimated monthly or annual total. +* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, +MMXT, MNTM, TPCP, TSNW) +* __M:__ used to indicate data element missing. +* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a +__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. +* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". +(EMXP, MXSD, TPCP, TSNW) +* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day +of occurrence. +* __Blank:__ No report + +#### fl_q (Quality flag) + +* __A:__ Accumulated amount +* __E:__ Estimated value +* __+:__ Value occurred on more than one day, last date of occurrence is used + +#### fl_d (Number of days flag ) + +Number of days is given as 00 when all days in the month are considered in +computing data value or otherwise the maximum number of consecutive days in the month considered +in computing the data value. + +#### fl_u (Units flag) + +* __C:__ Whole degree Celsius +* __D:__ Whole Fahrenheit Degree Day +* __F:__ Whole degree Fahrenheit +* __HI:__ Hundredths of inches +* __I:__ Whole inches +* __M:__ Whole miles +* __MH:__ Miles per hour +* __MM:__ Millimeters +* __NA:__ No units applicable (dimensionless) +* __TC:__ Tenths of degrees Celsius +* __TF:__ Tenths of degrees Fahrenheit +* __TI:__ Tenths of inches +* __TM:__ Tenths of millimeters +* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths +* __2:__ Soils, degrees Celsius, soil depth in whole centimeters +* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths +* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters +* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. + + + ### # Dataset: NORMAL_ANN __More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf) diff --git a/man-roxygen/noaa.r b/man-roxygen/noaa.r index 1d69b060..847e959e 100644 --- a/man-roxygen/noaa.r +++ b/man-roxygen/noaa.r @@ -1,23 +1,23 @@ -#' @param datasetid (required) Accepts a single valid dataset id. Data returned will be from the -#' dataset specified, see datasets() -#' @param startdate (required) Accepts valid ISO formated date (yyyy-mm-dd) or date time -#' (YYYY-MM-DDThh:mm:ss). Data returned will have data after the specified date. The -#' date range must be less than 1 year. -#' @param enddate (required) Accepts valid ISO formated date (yyyy-mm-dd) or date time -#' (YYYY-MM-DDThh:mm:ss). Data returned will have data before the specified date. The -#' date range must be less than 1 year. +#' @param datasetid (required) Accepts a single valid dataset id. Data +#' returned will be from the dataset specified, see \code{\link{ncdc_datasets}} +#' @param startdate (required) Accepts valid ISO formated date (yyyy-mm-dd) +#' or date time (YYYY-MM-DDThh:mm:ss). Data returned will have data after the +#' specified date. The date range must be less than 1 year. +#' @param enddate (required) Accepts valid ISO formated date (yyyy-mm-dd) or +#' date time (YYYY-MM-DDThh:mm:ss). Data returned will have data before the +#' specified date. The date range must be less than 1 year. #' @param dataset THIS IS A DEPRECATED ARGUMENT. See datasetid. #' @param datatype THIS IS A DEPRECATED ARGUMENT. See datatypeid. #' @param station THIS IS A DEPRECATED ARGUMENT. See stationid. #' @param location THIS IS A DEPRECATED ARGUMENT. See locationid. -#' @param locationtype THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 -#' of the NOAA API. -#' @param page THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 -#' of the NOAA API. -#' @param year THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate -#' arguments. -#' @param month THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate -#' arguments. -#' @param day THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate -#' arguments. +#' @param locationtype THIS IS A DEPRECATED ARGUMENT. There is no equivalent +#' argument in v2 of the NOAA API. +#' @param page THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument +#' in v2 of the NOAA API. +#' @param year THIS IS A DEPRECATED ARGUMENT. Use combination of startdate +#' and enddate arguments. +#' @param month THIS IS A DEPRECATED ARGUMENT. Use combination of startdate +#' and enddate arguments. +#' @param day THIS IS A DEPRECATED ARGUMENT. Use combination of startdate +#' and enddate arguments. #' @param results THIS IS A DEPRECATED ARGUMENT. See limit. diff --git a/man-roxygen/rnoaa.r b/man-roxygen/rnoaa.r index 0a11ad08..d78f6a19 100644 --- a/man-roxygen/rnoaa.r +++ b/man-roxygen/rnoaa.r @@ -1,11 +1,12 @@ -#' @param datatypeid Accepts a valid data type id or a vector or list of data type ids. -#' (optional) -#' @param locationid Accepts a valid location id or a vector or list of location ids -#' (optional) -#' @param sortfield The field to sort results by. Supports id, name, mindate, maxdate, and -#' datacoverage fields (optional) -#' @param sortorder Which order to sort by, asc or desc. Defaults to asc (optional) -#' @param limit Defaults to 25, limits the number of results in the response. Maximum is -#' 1000 (optional) +#' @param datatypeid Accepts a valid data type id or a vector or list of data +#' type ids. (optional) +#' @param locationid Accepts a valid location id or a vector or list of +#' location ids (optional) +#' @param sortfield The field to sort results by. Supports id, name, mindate, +#' maxdate, and datacoverage fields (optional) +#' @param sortorder Which order to sort by, asc or desc. Defaults to +#' asc (optional) +#' @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 ... Curl options passed on to \code{\link[httr]{GET}} (optional) diff --git a/man/ncdc.Rd b/man/ncdc.Rd index 758a993c..aa85c43e 100644 --- a/man/ncdc.Rd +++ b/man/ncdc.Rd @@ -12,32 +12,34 @@ ncdc(datasetid = NULL, datatypeid = NULL, stationid = NULL, day = NULL, includemetadata = TRUE, results = NULL, ...) } \arguments{ -\item{datasetid}{(required) Accepts a single valid dataset id. Data returned will be from the -dataset specified, see datasets()} +\item{datasetid}{(required) Accepts a single valid dataset id. Data +returned will be from the dataset specified, see \code{\link{ncdc_datasets}}} -\item{datatypeid}{Accepts a valid data type id or a vector or list of data type ids. -(optional)} +\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)} +\item{locationid}{Accepts a valid location id or a vector or list of +location ids (optional)} -\item{startdate}{(required) Accepts valid ISO formated date (yyyy-mm-dd) or date time -(YYYY-MM-DDThh:mm:ss). Data returned will have data after the specified date. The -date range must be less than 1 year.} +\item{startdate}{(required) Accepts valid ISO formated date (yyyy-mm-dd) +or date time (YYYY-MM-DDThh:mm:ss). Data returned will have data after the +specified date. The date range must be less than 1 year.} -\item{enddate}{(required) Accepts valid ISO formated date (yyyy-mm-dd) or date time -(YYYY-MM-DDThh:mm:ss). Data returned will have data before the specified date. The -date range must be less than 1 year.} +\item{enddate}{(required) Accepts valid ISO formated date (yyyy-mm-dd) or +date time (YYYY-MM-DDThh:mm:ss). Data returned will have data before the +specified date. The date range must be less than 1 year.} -\item{sortfield}{The field to sort results by. Supports id, name, mindate, maxdate, and -datacoverage fields (optional)} +\item{sortfield}{The field to sort results by. Supports id, name, mindate, +maxdate, and datacoverage fields (optional)} -\item{sortorder}{Which order to sort by, asc or desc. Defaults to asc (optional)} +\item{sortorder}{Which order to sort by, asc or desc. Defaults to +asc (optional)} -\item{limit}{Defaults to 25, limits the number of results in the response. Maximum is -1000 (optional)} +\item{limit}{Defaults to 25, limits the number of results in the response. +Maximum is 1000 (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} @@ -53,54 +55,59 @@ Climate Data Online access token generator. (required) See \item{location}{THIS IS A DEPRECATED ARGUMENT. See locationid.} -\item{locationtype}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 -of the NOAA API.} +\item{locationtype}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent +argument in v2 of the NOAA API.} -\item{page}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument in v2 -of the NOAA API.} +\item{page}{THIS IS A DEPRECATED ARGUMENT. There is no equivalent argument +in v2 of the NOAA API.} -\item{year}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate -arguments.} +\item{year}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate +and enddate arguments.} -\item{month}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate and enddate -arguments.} +\item{month}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate +and enddate arguments.} -\item{day}{THIS IS A DEPRECATED ARGUMENT. Use combination of startdate 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{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{...}{Curl options passed on to \code{\link[httr]{GET}} (optional)} } \value{ -An S3 list of length two, a slot of metadata (meta), and a slot for data (data). -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. +An S3 list of length two, a slot of metadata (meta), and a slot +for data (data). 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. } \description{ Search for and get NOAA NCDC data. } \details{ -Note that NOAA NCDC API calls can take a long time depending on the call. The NOAA API doesn't -perform well with very long timespans, and will time out and make you angry - beware. - -Keep in mind that three parameters, datasetid, startdate, and enddate are required. - -Note that the default limit (no. records returned) is 25. Look at the metadata in \code{$meta} -to see how many records were found. If more were found than 25, you could set the parameter -\code{limit} to something higher than 25. - -The attributes, or "flags", for each row of the output for data may have a flag -with it. Each \code{datasetid} has it's own set of flags. The following are flag -columns, and what they stand for. \code{fl_} is the beginning of each flag -column name, then one or more characters to describe the flag, keeping it short -to maintain a compact data frame. Some of these fields are the same across -datasetids. See the vignette \code{vignette("rnoaa_attributes", "rnoaa")} for +Note that NOAA NCDC API calls can take a long time depending on the call. +The NOAA API doesn't perform well with very long timespans, and will +time out and make you angry - beware. + +Keep in mind that three parameters, datasetid, startdate, and enddate +are required. + +Note that the default limit (no. records returned) is 25. Look at the +metadata in \code{$meta} to see how many records were found. If more were +found than 25, you could set the parameter \code{limit} to +something higher than 25. + +The attributes, or "flags", for each row of the output for data may have +a flag with it. Each \code{datasetid} has it's own set of flags. The +following are flag columns, and what they stand for. \code{fl_} is the +beginning of each flag column name, then one or more characters to describe +the flag, keeping it short to maintain a compact data frame. Some of +these fields are the same across datasetids. See the vignette +\code{vignette("rnoaa_attributes", "rnoaa")} for description of possible values for each flag. \itemize{ @@ -134,8 +141,8 @@ See \code{\link{Startup}} for information on how to create/find your \examples{ \dontrun{ # GHCN-Daily (or GHCND) data, for a specific station -ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', - enddate = '2013-12-01') +ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', + startdate = '2013-10-01', enddate = '2013-12-01') # GHCND data, for a location by FIPS code ncdc(datasetid='GHCND', locationid = 'FIPS:02', startdate = '2010-05-01', @@ -144,15 +151,18 @@ ncdc(datasetid='GHCND', locationid = 'FIPS:02', startdate = '2010-05-01', # GHCND data from October 1 2013 to December 1 2013 ncdc(datasetid='GHCND', startdate = '2013-10-01', enddate = '2013-10-05') -# GHCN-Monthly (or GHCNDMS) data from October 1 2013 to December 1 2013 -ncdc(datasetid='GHCNDMS', startdate = '2013-10-01', enddate = '2013-12-01') +# GHCN-Monthly (or GSOM) data from October 1 2013 to December 1 2013 +ncdc(datasetid='GSOM', startdate = '2013-10-01', enddate = '2013-12-01') +ncdc(datasetid='GSOM', startdate = '2013-10-01', enddate = '2013-12-01', + stationid = "GHCND:AE000041196") # Normals Daily (or NORMAL_DLY) GHCND:USW00014895 dly-tmax-normal data -ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', startdate = '2010-05-01', - enddate = '2010-05-10') +ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', + startdate = '2010-05-01', enddate = '2010-05-10') # Dataset, and location in Australia -ncdc(datasetid='GHCND', locationid='FIPS:AS', startdate = '2010-05-01', enddate = '2010-05-31') +ncdc(datasetid='GHCND', locationid='FIPS:AS', startdate = '2010-05-01', + enddate = '2010-05-31') # Dataset, location and datatype for PRECIP_HLY data ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', datatypeid='HPCP', @@ -167,19 +177,21 @@ ncdc(datasetid='PRECIP_HLY', locationid=c("FIPS:30103", "FIPS:30091"), startdate = '2010-05-01', enddate = '2010-05-10') # Dataset, location, station and datatype -ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', stationid='COOP:310301', datatypeid='HPCP', +ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', + stationid='COOP:310301', datatypeid='HPCP', startdate = '2010-05-01', enddate = '2010-05-10') # Dataset, location, and datatype for GHCND -ncdc(datasetid='GHCND', locationid='FIPS:BR', datatypeid='PRCP', startdate = '2010-05-01', - enddate = '2010-05-10') +ncdc(datasetid='GHCND', locationid='FIPS:BR', datatypeid='PRCP', + startdate = '2010-05-01', enddate = '2010-05-10') # Normals Daily GHCND dly-tmax-normal data -ncdc(datasetid='NORMAL_DLY', datatypeid='dly-tmax-normal', startdate = '2010-05-01', - enddate = '2010-05-10') +ncdc(datasetid='NORMAL_DLY', datatypeid='dly-tmax-normal', + startdate = '2010-05-01', enddate = '2010-05-10') # Normals Daily GHCND:USW00014895 dly-tmax-normal -ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', datatypeid='dly-tmax-normal', +ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', + datatypeid='dly-tmax-normal', startdate = '2010-05-01', enddate = '2010-05-10') # Hourly Precipitation data for ZIP code 28801 @@ -187,32 +199,33 @@ ncdc(datasetid='PRECIP_HLY', locationid='ZIP:28801', datatypeid='HPCP', startdate = '2010-05-01', enddate = '2010-05-10') # 15 min Precipitation data for ZIP code 28801 -ncdc(datasetid='PRECIP_15', datatypeid='QPCP', startdate = '2010-05-01', enddate = '2010-05-02') +ncdc(datasetid='PRECIP_15', datatypeid='QPCP', + startdate = '2010-05-01', enddate = '2010-05-02') # Search the NORMAL_HLY dataset -ncdc(datasetid='NORMAL_HLY', stationid = 'GHCND:USW00003812', startdate = '2010-05-01', - enddate = '2010-05-10') +ncdc(datasetid='NORMAL_HLY', stationid = 'GHCND:USW00003812', + startdate = '2010-05-01', enddate = '2010-05-10') -# Search the ANNUAL dataset +# Search the GSOY dataset ncdc(datasetid='ANNUAL', locationid='ZIP:28801', startdate = '2010-05-01', enddate = '2010-05-10') # Search the NORMAL_ANN dataset -ncdc(datasetid='NORMAL_ANN', datatypeid='ANN-DUTR-NORMAL', startdate = '2010-01-01', - enddate = '2010-01-01') +ncdc(datasetid='NORMAL_ANN', datatypeid='ANN-DUTR-NORMAL', + startdate = '2010-01-01', enddate = '2010-01-01') # Include metadata or not -ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', - enddate = '2013-12-01') -ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', startdate = '2013-10-01', - enddate = '2013-12-01', includemetadata=FALSE) +ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', + startdate = '2013-10-01', enddate = '2013-12-01') +ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', + startdate = '2013-10-01', enddate = '2013-12-01', includemetadata=FALSE) # Many stationid's stat <- ncdc_stations(startdate = "2000-01-01", enddate = "2016-01-01") ## find out what datasets might be available for these stations ncdc_datasets(stationid = stat$data$id[1]) ## get some data -ncdc(datasetid = "ANNUAL", stationid = stat$data$id[1:10], +ncdc(datasetid = "GSOY", stationid = stat$data$id[1:10], startdate = "2010-01-01", enddate = "2011-01-01") } diff --git a/man/ncdc_datasets.Rd b/man/ncdc_datasets.Rd index a7b24296..911f55dc 100644 --- a/man/ncdc_datasets.Rd +++ b/man/ncdc_datasets.Rd @@ -13,14 +13,14 @@ ncdc_datasets(datasetid = NULL, datatypeid = NULL, stationid = NULL, \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{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{locationid}{Accepts a valid location id or a vector or list of location ids -(optional)} +\item{locationid}{Accepts a valid location id or a vector or list of +location ids (optional)} \item{startdate}{(optional) Accepts valid ISO formated date (yyyy-mm-dd) or date time (YYYY-MM-DDThh:mm:ss). Data returned will have data after the specified date. The @@ -30,13 +30,14 @@ date range must be less than 1 year.} (YYYY-MM-DDThh:mm:ss). Data returned will have data before the specified date. The date range must be less than 1 year.} -\item{sortfield}{The field to sort results by. Supports id, name, mindate, maxdate, and -datacoverage fields (optional)} +\item{sortfield}{The field to sort results by. Supports id, name, mindate, +maxdate, and datacoverage fields (optional)} -\item{sortorder}{Which order to sort by, asc or desc. Defaults to asc (optional)} +\item{sortorder}{Which order to sort by, asc or desc. Defaults to +asc (optional)} -\item{limit}{Defaults to 25, limits the number of results in the response. Maximum is -1000 (optional)} +\item{limit}{Defaults to 25, limits the number of results in the response. +Maximum is 1000 (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} @@ -102,6 +103,7 @@ ncdc_datasets(stationid=c('COOP:310090','COOP:310184','COOP:310212')) # Multiple datatypeid's ncdc_datasets(datatypeid=c('ACMC','ACMH','ACSC')) ncdc_datasets(datasetid='ANNUAL', datatypeid=c('ACMC','ACMH','ACSC')) +ncdc_datasets(datasetid='GSOY', datatypeid=c('ACMC','ACMH','ACSC')) # Multiple locationid's ncdc_datasets(locationid="FIPS:30091") diff --git a/man/ncdc_datatypes.Rd b/man/ncdc_datatypes.Rd index 7c0a15cf..9cd2fa9f 100644 --- a/man/ncdc_datatypes.Rd +++ b/man/ncdc_datatypes.Rd @@ -13,8 +13,8 @@ ncdc_datatypes(datasetid = NULL, datatypeid = NULL, datacategoryid = NULL, \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{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 @@ -23,8 +23,8 @@ more than one data category)} \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)} +\item{locationid}{Accepts a valid location id or a vector or list of +location ids (optional)} \item{startdate}{(optional) Accepts valid ISO formated date (yyyy-mm-dd) or date time (YYYY-MM-DDThh:mm:ss). Data returned will have data after the specified date. The @@ -34,13 +34,14 @@ date range must be less than 1 year.} (YYYY-MM-DDThh:mm:ss). Data returned will have data before the specified date. The date range must be less than 1 year.} -\item{sortfield}{The field to sort results by. Supports id, name, mindate, maxdate, and -datacoverage fields (optional)} +\item{sortfield}{The field to sort results by. Supports id, name, mindate, +maxdate, and datacoverage fields (optional)} -\item{sortorder}{Which order to sort by, asc or desc. Defaults to asc (optional)} +\item{sortorder}{Which order to sort by, asc or desc. Defaults to +asc (optional)} -\item{limit}{Defaults to 25, limits the number of results in the response. Maximum is -1000 (optional)} +\item{limit}{Defaults to 25, limits the number of results in the response. +Maximum is 1000 (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} @@ -93,7 +94,10 @@ ncdc_datatypes(datatypeid="ACMH") ncdc_datatypes(datatypeid="ACSC") # datasetid, one or many +## ANNUAL should be replaced by GSOY, but both exist and give +## different answers ncdc_datatypes(datasetid="ANNUAL") +ncdc_datatypes(datasetid="GSOY") ncdc_datatypes(datasetid=c("ANNUAL", "PRECIP_HLY")) # Fetch data types with the air temperature data category diff --git a/man/ncdc_locs.Rd b/man/ncdc_locs.Rd index 2d98473f..5670f8d4 100644 --- a/man/ncdc_locs.Rd +++ b/man/ncdc_locs.Rd @@ -75,7 +75,8 @@ ncdc_locs(locationid='FIPS:37') # Fetch available locations for the GHCND (Daily Summaries) dataset ncdc_locs(datasetid='GHCND') ncdc_locs(datasetid=c('GHCND', 'ANNUAL')) -ncdc_locs(datasetid=c('GHCND', 'GHCNDMS')) +ncdc_locs(datasetid=c('GSOY', 'ANNUAL')) +ncdc_locs(datasetid=c('GHCND', 'GSOM')) # Fetch all U.S. States ncdc_locs(locationcategoryid='ST', limit=52) diff --git a/man/ncdc_locs_cats.Rd b/man/ncdc_locs_cats.Rd index 88bcb8a0..84c966f3 100644 --- a/man/ncdc_locs_cats.Rd +++ b/man/ncdc_locs_cats.Rd @@ -74,9 +74,11 @@ ncdc_locs_cats(locationcategoryid='CLIM_REG') # Displays available location categories within GHCN-Daily dataset ncdc_locs_cats(datasetid='GHCND') +ncdc_locs_cats(datasetid='GSOY') +ncdc_locs_cats(datasetid='ANNUAL') # multiple datasetid's -ncdc_locs_cats(datasetid=c('GHCND', 'GHCNDMS')) +ncdc_locs_cats(datasetid=c('GHCND', 'GSOM')) # Displays available location categories from start date 1970-01-01 ncdc_locs_cats(startdate='1970-01-01') diff --git a/man/ncdc_stations.Rd b/man/ncdc_stations.Rd index aa74240f..7999eafd 100644 --- a/man/ncdc_stations.Rd +++ b/man/ncdc_stations.Rd @@ -17,11 +17,11 @@ 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{datatypeid}{Accepts a valid data type id or a vector or list of data type ids. -(optional)} +\item{datatypeid}{Accepts a valid data type id or a vector or list of data +type ids. (optional)} -\item{locationid}{Accepts a valid location id or a vector or list of location ids -(optional)} +\item{locationid}{Accepts a valid location id or a vector or list of +location ids (optional)} \item{startdate}{(optional) Accepts valid ISO formated date (yyyy-mm-dd) or date time (YYYY-MM-DDThh:mm:ss). Data returned will have data after the specified date. The @@ -31,13 +31,14 @@ date range must be less than 1 year.} (YYYY-MM-DDThh:mm:ss). Data returned will have data before the specified date. The date range must be less than 1 year.} -\item{sortfield}{The field to sort results by. Supports id, name, mindate, maxdate, and -datacoverage fields (optional)} +\item{sortfield}{The field to sort results by. Supports id, name, mindate, +maxdate, and datacoverage fields (optional)} -\item{sortorder}{Which order to sort by, asc or desc. Defaults to asc (optional)} +\item{sortorder}{Which order to sort by, asc or desc. Defaults to +asc (optional)} -\item{limit}{Defaults to 25, limits the number of results in the response. Maximum is -1000 (optional)} +\item{limit}{Defaults to 25, limits the number of results in the response. +Maximum is 1000 (optional)} \item{offset}{Defaults to 0, used to offset the resultlist (optional)} @@ -110,8 +111,9 @@ lapply(c("COOP:010008", "COOP:010063", "COOP:010116"), function(z) { }$data) # Displays all stations within GHCN-Daily (100 Stations per page limit) -ncdc_stations(datasetid='GHCND') -ncdc_stations(datasetid=c('GHCND', 'ANNUAL')) +ncdc_stations(datasetid = 'GHCND') +ncdc_stations(datasetid = 'ANNUAL') +ncdc_stations(datasetid = 'GSOY') # Station ncdc_stations(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895') diff --git a/vignettes/ncdc_attributes.Rmd b/vignettes/ncdc_attributes.Rmd index fd2243c9..9fd83894 100644 --- a/vignettes/ncdc_attributes.Rmd +++ b/vignettes/ncdc_attributes.Rmd @@ -26,9 +26,9 @@ below details on each dataset. __Datasets__ -* [ANNUAL](#annual) * [GHCND](#ghcnd) -* [GHCNDMS](#ghcndms) +* [GSOM](#gsom) +* [GSOY](#gsoy) * [NORMAL_ANN](#normalann) * [NORMAL_DLY](#normaldly) * [NORMAL_HLY](#normalhly) @@ -38,60 +38,6 @@ __Datasets__ * NEXRAD2 - not working yet * NEXRAD3 - not working yet -### # Dataset: ANNUAL - -__More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ANNUAL_documentation.pdf) - -#### fl_m (Measurement flag) - -* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months -(TPCP). -* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. -(CLDD, HTDD) -* __E:__ An estimated monthly or annual total. -* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, -MMXT, MNTM, TPCP, TSNW) -* __M:__ used to indicate data element missing. -* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a -__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. -* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". -(EMXP, MXSD, TPCP, TSNW) -* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day -of occurrence. -* __Blank:__ No report - -#### fl_q (Quality flag) - -* __A:__ Accumulated amount -* __E:__ Estimated value -* __+:__ Value occurred on more than one day, last date of occurrence is used - -#### fl_d (Number of days flag ) - -Number of days is given as 00 when all days in the month are considered in -computing data value or otherwise the maximum number of consecutive days in the month considered -in computing the data value. - -#### fl_u (Units flag) - -* __C:__ Whole degree Celsius -* __D:__ Whole Fahrenheit Degree Day -* __F:__ Whole degree Fahrenheit -* __HI:__ Hundredths of inches -* __I:__ Whole inches -* __M:__ Whole miles -* __MH:__ Miles per hour -* __MM:__ Millimeters -* __NA:__ No units applicable (dimensionless) -* __TC:__ Tenths of degrees Celsius -* __TF:__ Tenths of degrees Fahrenheit -* __TI:__ Tenths of inches -* __TM:__ Tenths of millimeters -* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths -* __2:__ Soils, degrees Celsius, soil depth in whole centimeters -* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths -* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters -* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. ### # Dataset: GHCND @@ -159,7 +105,11 @@ in computing the data value. Is the (2 digit hour, 2 digit minute) 24 hour clock time of the observation given as the local time at the station of record. -### # Dataset: GHCNDMS + + +### # Dataset: GSOM + +__More info:__ Observations are synonymous with elements or values, and defined in Table A below. 9999 indicates missing data or data that has not been received. @@ -174,6 +124,64 @@ Defined as total number of days observation/element is missing in that month. Th Defined as the maximum number of consecutive days in the month that an observation/element is missing. + +### # Dataset: GSOY + +__More info:__ + +#### fl_m (Measurement flag) + +* __A:__ Accumulated amount. This value is a total that may include data from a previous month or months +(TPCP). +* __B:__ Adjusted Total. Monthly value totals based on proportional available data across the entire month. +(CLDD, HTDD) +* __E:__ An estimated monthly or annual total. +* __I:__ Monthly means or totals based on incomplete time series. 1 to 9 days are missing. (MMNT,MMXP, +MMXT, MNTM, TPCP, TSNW) +* __M:__ used to indicate data element missing. +* __S:__ Precipitation for the amount is continuing to be accumulated. Total will be included in a +__subsequent value (TPCP). Example:__ Days 1-20 had 1.35 inches of precipitation, then a period of accumulation began. The element TPCP would then be 00135S and the total accumulated amount value appears in a subsequent monthly value. If TPCP = 0 there was no precipitation measured during the month. flag 1 is set to "S" and the total accumulated amount appears in a subsequent monthly value. +* __T:__ Trace of precipitation, snowfall, or snow depth. The precipitation data value will = "00000". +(EMXP, MXSD, TPCP, TSNW) +* __+:__ The phenomena in question occurred on several days. The date in the DAY field is the last day +of occurrence. +* __Blank:__ No report + +#### fl_q (Quality flag) + +* __A:__ Accumulated amount +* __E:__ Estimated value +* __+:__ Value occurred on more than one day, last date of occurrence is used + +#### fl_d (Number of days flag ) + +Number of days is given as 00 when all days in the month are considered in +computing data value or otherwise the maximum number of consecutive days in the month considered +in computing the data value. + +#### fl_u (Units flag) + +* __C:__ Whole degree Celsius +* __D:__ Whole Fahrenheit Degree Day +* __F:__ Whole degree Fahrenheit +* __HI:__ Hundredths of inches +* __I:__ Whole inches +* __M:__ Whole miles +* __MH:__ Miles per hour +* __MM:__ Millimeters +* __NA:__ No units applicable (dimensionless) +* __TC:__ Tenths of degrees Celsius +* __TF:__ Tenths of degrees Fahrenheit +* __TI:__ Tenths of inches +* __TM:__ Tenths of millimeters +* __1:__ Soils, degrees Fahrenheit, soil depths in inches and hundredths +* __2:__ Soils, degrees Celsius, soil depth in whole centimeters +* __3:__ Soils, degrees Celsius, soil, soil depth in inches and hundredths +* __4:__ Soils, degrees Fahrenheit, soil depth in whole centimeters +* __5:__ Soils, If the soil station closed during the current month, '5' indicates the station has closed. + + + ### # Dataset: NORMAL_ANN __More info:__ [http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf](http://www1.ncdc.noaa.gov/pub/data/cdo/documentation/NORMAL_ANN_documentation.pdf)