diff --git a/R/homr.R b/R/homr.R index 4d3f683a..240189b6 100644 --- a/R/homr.R +++ b/R/homr.R @@ -45,6 +45,8 @@ #' descriptions information. #' #' @return A list, with elements named by the station ids. +#' +#' @references \url{http://www.ncdc.noaa.gov/homr/api} #' #' @examples \donttest{ #' homr(qid = 'COOP:046742') @@ -56,7 +58,7 @@ #' homr(headersOnly=TRUE, country='GHANA') #' homr(headersOnly=TRUE, state='NC', county='BUNCOMBE') #' homr(name='CLAYTON') -#' res <- homr(name='CLAYTON', combine=TRUE) +#' res <- homr(state='NC', county='BUNCOMBE', combine=TRUE) #' res$id #' res$head #' res$updates diff --git a/R/rnoaa-package.r b/R/rnoaa-package.r index 15abd233..54cd613e 100644 --- a/R/rnoaa-package.r +++ b/R/rnoaa-package.r @@ -36,4 +36,26 @@ NULL #' @keywords datasets #' @format A data frame with 3142 rows and 5 variables #' @name fipscodes -NULL \ No newline at end of file +NULL + +#' NOAA storm data from International Best Track Archive for Climate Stewardship (IBTrACS). +#' +#' This dataset includes description of the columns of each dataset acquired using +#' \code{\link[rnoaa]{storm_data}} +#' +#' @docType data +#' @keywords datasets +#' @format A data frame with 195 rows and 8 variables +#' @name storm_columns +NULL + +#' NOAA storm data from International Best Track Archive for Climate Stewardship (IBTrACS). +#' +#' This dataset includes a crosswalk from storm serial numbers to their names. Storm serial numbers +#' are used to search for storms in the \code{\link[rnoaa]{storm_data}} function. +#' +#' @docType data +#' @keywords datasets +#' @format A data frame with 12,209 rows and 2 variables +#' @name storm_names +NULL diff --git a/R/storms.R b/R/storms.R index ad5933fa..d9cc078b 100644 --- a/R/storms.R +++ b/R/storms.R @@ -22,6 +22,8 @@ #' May 23, 1970 near 19°N 91°E #' #' See \url{http://www.ncdc.noaa.gov/ibtracs/index.php?name=numbering} for more. +#' +#' @references \url{http://www.ncdc.noaa.gov/ibtracs/index.php?name=wmo-data} #' #' @examples \donttest{ #' storm_data(basin='WP') @@ -36,7 +38,7 @@ #' } storm_data <- function(basin=NULL, storm=NULL, year=NULL, path="~/.rnoaa/storms", - overwrite = TRUE, read = TRUE){ + overwrite = TRUE){ csvpath <- csv_local(basin, storm, year, path) if(!is_storm(x = csvpath)){ diff --git a/R/storms_meta.R b/R/storms_meta.R index 54c59af8..55610443 100644 --- a/R/storms_meta.R +++ b/R/storms_meta.R @@ -1,6 +1,8 @@ #' Get NOAA wind storm metadata. #' #' @export +#' +#' @param what (character) One of storm_columns or storm_names. #' #' @examples \donttest{ #' head( storm_meta() ) diff --git a/R/tornadoes.R b/R/tornadoes.R index f6be59c1..ee5c2176 100644 --- a/R/tornadoes.R +++ b/R/tornadoes.R @@ -3,10 +3,13 @@ #' @export #' @param path A path to store the files, Default: \code{~/.ots/kelp} #' @param overwrite (logical) To overwrite the path to store files in or not, Default: TRUE. +#' #' @return A Spatial object is returned of class SpatialLinesDataFrame. +#' @references \url{http://www.spc.noaa.gov/gis/svrgis/} #' #' @examples \donttest{ #' shp <- tornadoes() +#' library('sp') #' plot(shp) # may take 10 sec or so to render #' } diff --git a/R/zzz.r b/R/zzz.r index e6d8b243..8d8dcbcc 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -177,12 +177,6 @@ check_response_swdi <- function(x, format){ noaa_compact <- function (l) Filter(Negate(is.null), l) -fread_csv <- function(x){ - tmp <- data.frame(suppressWarnings(fread(x))) - names(tmp) <- tolower(names(tmp)) - tmp -} - read_csv <- function(x){ tmp <- read.csv(x, header = FALSE, sep = ",", stringsAsFactors=FALSE, skip = 3) nmz <- names(read.csv(x, header = TRUE, sep = ",", stringsAsFactors=FALSE, skip = 1, nrows=1)) diff --git a/inst/img/tornadoes.png b/inst/img/tornadoes.png new file mode 100644 index 00000000..bae3b94a Binary files /dev/null and b/inst/img/tornadoes.png differ diff --git a/man/storm_columns.Rd b/man/storm_columns.Rd new file mode 100644 index 00000000..3df671e5 --- /dev/null +++ b/man/storm_columns.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\docType{data} +\name{storm_columns} +\alias{storm_columns} +\title{NOAA storm data from International Best Track Archive for Climate Stewardship (IBTrACS).} +\format{A data frame with 195 rows and 8 variables} +\description{ +This dataset includes description of the columns of each dataset acquired using +\code{\link[rnoaa]{storm_data}} +} +\keyword{datasets} + diff --git a/man/storm_data.Rd b/man/storm_data.Rd index 72f8ddce..5787ac6f 100644 --- a/man/storm_data.Rd +++ b/man/storm_data.Rd @@ -4,7 +4,7 @@ \title{Get NOAA wind storm data from International Best Track Archive for Climate Stewardship (IBTrACS)} \usage{ storm_data(basin = NULL, storm = NULL, year = NULL, - path = "~/.rnoaa/storms", overwrite = TRUE, read = TRUE) + path = "~/.rnoaa/storms", overwrite = TRUE) } \arguments{ \item{basin}{(character) A basin name, one of EP, NA, NI, SA, SI, SP, or WP.} diff --git a/man/storm_meta.Rd b/man/storm_meta.Rd index bea56542..39bfc317 100644 --- a/man/storm_meta.Rd +++ b/man/storm_meta.Rd @@ -5,6 +5,9 @@ \usage{ storm_meta(what = "storm_columns") } +\arguments{ +\item{what}{(character) One of storm_columns or storm_names.} +} \description{ Get NOAA wind storm metadata. } diff --git a/man/storm_names.Rd b/man/storm_names.Rd new file mode 100644 index 00000000..032a4fb4 --- /dev/null +++ b/man/storm_names.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\docType{data} +\name{storm_names} +\alias{storm_names} +\title{NOAA storm data from International Best Track Archive for Climate Stewardship (IBTrACS).} +\format{A data frame with 12,209 rows and 2 variables} +\description{ +This dataset includes a crosswalk from storm serial numbers to their names. Storm serial numbers +are used to search for storms in the \code{\link[rnoaa]{storm_data}} function. +} +\keyword{datasets} +