Skip to content

Commit

Permalink
tidied up man files, added img for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Oct 14, 2014
1 parent faa458d commit bd01e07
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 10 deletions.
4 changes: 3 additions & 1 deletion R/homr.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down
24 changes: 23 additions & 1 deletion R/rnoaa-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,26 @@ NULL
#' @keywords datasets
#' @format A data frame with 3142 rows and 5 variables
#' @name fipscodes
NULL
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
4 changes: 3 additions & 1 deletion R/storms.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)){
Expand Down
2 changes: 2 additions & 0 deletions R/storms_meta.R
Original file line number Diff line number Diff line change
@@ -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() )
Expand Down
3 changes: 3 additions & 0 deletions R/tornadoes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#' }

Expand Down
6 changes: 0 additions & 6 deletions R/zzz.r
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Binary file added inst/img/tornadoes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions man/storm_columns.Rd
Original file line number Diff line number Diff line change
@@ -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}

2 changes: 1 addition & 1 deletion man/storm_data.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down
3 changes: 3 additions & 0 deletions man/storm_meta.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
12 changes: 12 additions & 0 deletions man/storm_names.Rd
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit bd01e07

Please sign in to comment.