diff --git a/.Rbuildignore b/.Rbuildignore index 361717f7..d6820c6f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -19,3 +19,4 @@ README.Rmd vignettes/figure ^CONDUCT\.md$ user_test_cases/ +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index a036efee..1f042b4e 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.5.9.9140 +Version: 0.6.0 License: MIT + file LICENSE Encoding: UTF-8 Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index fe62dd5d..506e9d93 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -120,7 +120,6 @@ importFrom(dplyr,bind_rows) importFrom(dplyr,contains) importFrom(dplyr,filter) importFrom(dplyr,mutate) -importFrom(dplyr,rbind_all) importFrom(dplyr,rename) importFrom(dplyr,select) importFrom(dplyr,tbl_df) diff --git a/NEWS.md b/NEWS.md index 1cbae432..7d1c476d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,46 @@ +rnoaa 0.6.0 +=============== + +### NEW FEATURES + +* A large PR was merged with a suite of functions. Most functions added +a prefixed with `meteo_*`, and are meant to find weather monitors near +locations (`meteo_nearby_stations`), find all monitors within a radius +of a location (`meteo_distance`), calculate the distances between a +location and all available stations (`meteo_process_geographic_data`), +calculate the distance between two locations (`meteo_spherical_distance`), +pull GHCND weather data for multiple weather monitors (`meteo_pull_monitors`), +create a tidy GHCND dataset from a single monitor (`meteo_tidy_ghcnd`), +and determine the "coverage" for a station data frame (`meteo_coverage()`). +In addition, `vis_miss()` added to visualize missingness in a data.frame. See +the [PR diff against master](https://github.com/ropensci/rnoaa/pull/159/files) +for all the changes. (#159) Thanks a ton to @geanders _et al_. (@hrbrmstr, +@masalmon, @jdunic, @njtierney, @leighseverson, @RyanGan, @mandilin, @jferreri, +@cpatrizio88, @ryan-hicks, @Ewen2015, @mgutilla, @hakessler, @rodlammers) + +### MINOR IMPROVEMENTS + +* `isd_stations_search()` changed internal structure. We replaced +usage of `geojsonio` and `lawn` for faster `dplyr::filter` for +bbox inputs, and `meteo_distance()` for `lat/long/radius` inputs +. This speeds up this function significantly. Thanks to @lukas-rokka +(#157) +* `isd_stations_search()` and `isd_stations()` now return +tibble's instead of data.frame's +* Removed cached ISD stations dataset within package to reduce +package size. Only change is now that on first use of the function +the user has to download the entire thing, but on subsquent +uses it will pull from the cached version on the users machine. +`isd_stations_search()` now caches using `rappdirs` (#161) +* Convert all `is()` uses to `inherits()` + +### BUG FIXES + +* Fixed `seaiceeurls()` function that's used to generate urls for +the `seaice()` function - due to change in NOAA urls (#160) +* Fix to function `ghncd_split_vars()` to not fail on `dplyr::contains` +call (#156) thanks @lawinslow ! + rnoaa 0.5.6 =============== @@ -6,24 +49,24 @@ rnoaa 0.5.6 * Fixes for new `httr` version to call encoding explicitly (#135) * Fix to broken link for reference to source code used in `gefs` functions (#121) * Speed ups implemented for the `isd()` function - it's a time consuming task -as we have to parse a nasty string of characters line by line - more speed +as we have to parse a nasty string of characters line by line - more speed ups to come in future versions (#146) * Replace `dplyr::rbind_all()` with `dplyr::bind_rows()` as the former is being deprecated (#152) ### BUG FIXES -* Fix for `isd()` function - was failing on some station names that had +* Fix for `isd()` function - was failing on some station names that had leading zeros. (#136) -* Fix for `ncdc_stations()` - used to allow more than one station id to -be passed in, but internally only handled one. This is a restriction -due to the NOAA NCDC API. Documentation now shows an example of how +* Fix for `ncdc_stations()` - used to allow more than one station id to +be passed in, but internally only handled one. This is a restriction +due to the NOAA NCDC API. Documentation now shows an example of how to deal with many station ids (#138) * Fixes to the suite of `ncdc_*()` functions to allow multiple inputs to those parameters where allowed (#139) * Fixed bug in `ncdc_plot()` due to new `ggplot2` version (#153) -* Fixed bugs in `argo()` functions: a) with new `httr`, box input of a vector -no longer works, now manually make a character vector; b) errant file param +* Fixed bugs in `argo()` functions: a) with new `httr`, box input of a vector +no longer works, now manually make a character vector; b) errant file param being passed into the http request, removed (#155) rnoaa 0.5.2 @@ -33,7 +76,7 @@ rnoaa 0.5.2 * New data source added: ARGO buoy data. See functions starting with `argo()` (#123) for more, see http://www.argo.ucsd.edu/ -* New data source added: CO-OPS tide and current data. See function `coops_search()` +* New data source added: CO-OPS tide and current data. See function `coops_search()` (#111) for idea from @fmichonneau (#124) for implementing @jsta See http://co-ops.nos.noaa.gov/api/ also (#126) (#128) @@ -48,35 +91,35 @@ rnoaa 0.5.0 ### NEW FEATURES -* New data source added: NOAA Global Ensemble Forecast System (GEFS) data. -See functions `gefs()`, `gefs_dimension_values()`, `gefs_dimensions()`, `gefs_latitudes()`, -`gefs_longitudes()`, and `gefs_variables()` (#106) (#119) thanks @potterzot - he's +* New data source added: NOAA Global Ensemble Forecast System (GEFS) data. +See functions `gefs()`, `gefs_dimension_values()`, `gefs_dimensions()`, `gefs_latitudes()`, +`gefs_longitudes()`, and `gefs_variables()` (#106) (#119) thanks @potterzot - he's now an author too -* New data source added: NOAA Extended Reconstructed Sea Surface Temperature +* New data source added: NOAA Extended Reconstructed Sea Surface Temperature (ERSST) data. See function `ersst()` (#96) * New function `isd_stations()` to get ISD station data. * Added code of conduct to code repository ### MINOR IMPROVEMENTS -* Swapped `ncdf` package for `ncdf4` package. Windows binaries weren't +* Swapped `ncdf` package for `ncdf4` package. Windows binaries weren't availiable for `ncdf4` prior to now. (#117) * Proper license info added for javascript modules used inside the package (#116) -* Improvements to `isd()` function to do transformations of certain +* Improvements to `isd()` function to do transformations of certain variables to give back data that makes more sense (#115) -* `leaflet`, `geojsonio`, and `lawn` added in Suggests, used in a few +* `leaflet`, `geojsonio`, and `lawn` added in Suggests, used in a few functions. -* Note added to `swdi()` function man page that the `nldn` dataset is +* Note added to `swdi()` function man page that the `nldn` dataset is available to military users only (#107) ### BUG FIXES -* Fix to `buoy()` function to accept character class inputs for the -`buoyid` parameter. the error occurred because matching was not +* Fix to `buoy()` function to accept character class inputs for the +`buoyid` parameter. the error occurred because matching was not case-insensitive, now works regardless of case (#118) * Fixes for new `ggplot2` version (#113) -* Built in `GET` request retries for `ghncd` functions as +* Built in `GET` request retries for `ghncd` functions as some URLs fail unpredictably (#110) rnoaa 0.4.2 diff --git a/R/isd_stations_search.R b/R/isd_stations_search.R index 72210808..bcd797c1 100644 --- a/R/isd_stations_search.R +++ b/R/isd_stations_search.R @@ -71,6 +71,6 @@ isd_stations_search <- function(lat = NULL, lon = NULL, radius = NULL, bbox = NU filter(stations, lat >= bbox[2] & lat <= bbox[4], lon >= bbox[1] & lon <= bbox[3]) } else { stations <- rename(stations, latitude = lat, longitude = lon) - meteo_distance(stations, lat, lon, radius = radius) + meteo_distance(stations, lat = lat, long = lon, radius = radius) } } diff --git a/R/ncdc_plot.r b/R/ncdc_plot.r index 97f283e5..54f10d76 100644 --- a/R/ncdc_plot.r +++ b/R/ncdc_plot.r @@ -65,7 +65,7 @@ ncdc_plot.ncdc_data <- function(..., breaks = NULL, dateformat='%d/%m/%y') { } #' @export -ncdc_plot.default <- function(..., breaks = NULL, dateformat='%d/%m/%y') { +ncdc_plot.default <- function(..., breaks = NULL, dateformat = '%d/%m/%y') { stop("No method for ", class(list(...)[[1]]), call. = FALSE) } @@ -77,7 +77,6 @@ plot_template <- function(df, breaks, dateformat) { ) if (!is.null(breaks)) { c(tt, scale_x_date(date_breaks = breaks, date_labels = dateformat)) - } else { tt } diff --git a/R/rnoaa-package.r b/R/rnoaa-package.r index 41b05b59..8286ef4d 100644 --- a/R/rnoaa-package.r +++ b/R/rnoaa-package.r @@ -60,7 +60,7 @@ #' @importFrom tidyr gather #' @importFrom rappdirs user_cache_dir #' @importFrom gridExtra grid.arrange -#' @importFrom dplyr %>% rbind_all select mutate rename tbl_df filter bind_rows +#' @importFrom dplyr %>% select mutate rename tbl_df filter bind_rows #' as_data_frame contains #' @importFrom tibble as_data_frame #' @importFrom scales comma diff --git a/cran-comments.md b/cran-comments.md index 0a5786d6..e53bd398 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,27 @@ -R CMD CHECK passed on my local OS X install on R 3.3.0 and R development -version, Ubuntu running on Travis-CI, and Win builder. +## Test environments -This submission makes some fixes for new versions of dependencies, -and fixes a series of bugs. +* local OS X install, R 3.3.1 +* ubuntu 12.04 (on travis-ci), R 3.3.1 +* win-builder (devel and release) -Thanks! Scott Chamberlain +## R CMD check results + +0 errors | 0 warnings | 1 note + + License components with restrictions and base license permitting such: + MIT + file LICENSE + File 'LICENSE': + YEAR: 2016 + COPYRIGHT HOLDER: Scott Chamberlain + +## Reverse dependencies + +There are no reverse dependencies. + +----- + +This release adds some new functions, improves performance +in a function, fixes a few bugs. + +Thanks! +Scott Chamberlain diff --git a/inst/vign/buoy_vignette.md b/inst/vign/buoy_vignette.md index ae506d82..0786d1a4 100644 --- a/inst/vign/buoy_vignette.md +++ b/inst/vign/buoy_vignette.md @@ -73,18 +73,18 @@ buoy(dataset = 'cwind', buoyid = 46085) #> Dimensions (rows/cols): [33486 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2007-05-05T02:00:00Z 55.855 -142.559 331 2.8 -#> 2 2007-05-05T02:10:00Z 55.855 -142.559 328 2.6 -#> 3 2007-05-05T02:20:00Z 55.855 -142.559 329 2.2 -#> 4 2007-05-05T02:30:00Z 55.855 -142.559 356 2.1 -#> 5 2007-05-05T02:40:00Z 55.855 -142.559 360 1.5 -#> 6 2007-05-05T02:50:00Z 55.855 -142.559 10 1.9 -#> 7 2007-05-05T03:00:00Z 55.855 -142.559 10 2.2 -#> 8 2007-05-05T03:10:00Z 55.855 -142.559 14 2.2 -#> 9 2007-05-05T03:20:00Z 55.855 -142.559 16 2.1 -#> 10 2007-05-05T03:30:00Z 55.855 -142.559 22 1.6 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2007-05-05T02:00:00Z 55.855 -142.559 331 2.8 +#> 2 2007-05-05T02:10:00Z 55.855 -142.559 328 2.6 +#> 3 2007-05-05T02:20:00Z 55.855 -142.559 329 2.2 +#> 4 2007-05-05T02:30:00Z 55.855 -142.559 356 2.1 +#> 5 2007-05-05T02:40:00Z 55.855 -142.559 360 1.5 +#> 6 2007-05-05T02:50:00Z 55.855 -142.559 10 1.9 +#> 7 2007-05-05T03:00:00Z 55.855 -142.559 10 2.2 +#> 8 2007-05-05T03:10:00Z 55.855 -142.559 14 2.2 +#> 9 2007-05-05T03:20:00Z 55.855 -142.559 16 2.1 +#> 10 2007-05-05T03:30:00Z 55.855 -142.559 22 1.6 +#> .. ... ... ... ... ... ``` Including year @@ -98,18 +98,18 @@ buoy(dataset = 'cwind', buoyid = 41001, year = 1999) #> Dimensions (rows/cols): [52554 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 1999-01-01T00:00:00Z 34.68 -72.66 272 11.7 -#> 2 1999-01-01T00:10:00Z 34.68 -72.66 260 11.0 -#> 3 1999-01-01T00:20:00Z 34.68 -72.66 249 8.7 -#> 4 1999-01-01T00:30:00Z 34.68 -72.66 247 8.4 -#> 5 1999-01-01T00:40:00Z 34.68 -72.66 240 7.1 -#> 6 1999-01-01T00:50:00Z 34.68 -72.66 242 7.9 -#> 7 1999-01-01T01:00:00Z 34.68 -72.66 246 8.3 -#> 8 1999-01-01T01:10:00Z 34.68 -72.66 297 10.9 -#> 9 1999-01-01T01:20:00Z 34.68 -72.66 299 11.3 -#> 10 1999-01-01T01:30:00Z 34.68 -72.66 299 11.1 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 1999-01-01T00:00:00Z 34.68 -72.66 272 11.7 +#> 2 1999-01-01T00:10:00Z 34.68 -72.66 260 11.0 +#> 3 1999-01-01T00:20:00Z 34.68 -72.66 249 8.7 +#> 4 1999-01-01T00:30:00Z 34.68 -72.66 247 8.4 +#> 5 1999-01-01T00:40:00Z 34.68 -72.66 240 7.1 +#> 6 1999-01-01T00:50:00Z 34.68 -72.66 242 7.9 +#> 7 1999-01-01T01:00:00Z 34.68 -72.66 246 8.3 +#> 8 1999-01-01T01:10:00Z 34.68 -72.66 297 10.9 +#> 9 1999-01-01T01:20:00Z 34.68 -72.66 299 11.3 +#> 10 1999-01-01T01:30:00Z 34.68 -72.66 299 11.1 +#> .. ... ... ... ... ... ``` Including year and datatype @@ -123,18 +123,18 @@ buoy(dataset = 'cwind', buoyid = 41001, year = 2008, datatype = "cc") #> Dimensions (rows/cols): [1585 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 -#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 -#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 -#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 -#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 -#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 -#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 -#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 -#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 -#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 +#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 +#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 +#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 +#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 +#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 +#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 +#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 +#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 +#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 +#> .. ... ... ... ... ... ``` Including just datatype @@ -148,16 +148,16 @@ buoy(dataset = 'cwind', buoyid = 41001, datatype = "cc") #> Dimensions (rows/cols): [1585 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 -#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 -#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 -#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 -#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 -#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 -#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 -#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 -#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 -#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 +#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 +#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 +#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 +#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 +#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 +#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 +#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 +#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 +#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 +#> .. ... ... ... ... ... ``` diff --git a/inst/vign/figure/seaice1-1.png b/inst/vign/figure/seaice1-1.png index ef867c1e..c7be181b 100644 Binary files a/inst/vign/figure/seaice1-1.png and b/inst/vign/figure/seaice1-1.png differ diff --git a/inst/vign/figure/seaice2-1.png b/inst/vign/figure/seaice2-1.png index f90ef4d1..88df1702 100644 Binary files a/inst/vign/figure/seaice2-1.png and b/inst/vign/figure/seaice2-1.png differ diff --git a/inst/vign/figure/unnamed-chunk-3-1.png b/inst/vign/figure/unnamed-chunk-3-1.png index 938498ef..eb5302c9 100644 Binary files a/inst/vign/figure/unnamed-chunk-3-1.png and b/inst/vign/figure/unnamed-chunk-3-1.png differ diff --git a/inst/vign/figure/unnamed-chunk-4-1.png b/inst/vign/figure/unnamed-chunk-4-1.png index ee481dcd..a2c28a8d 100644 Binary files a/inst/vign/figure/unnamed-chunk-4-1.png and b/inst/vign/figure/unnamed-chunk-4-1.png differ diff --git a/inst/vign/figure/unnamed-chunk-7-1.png b/inst/vign/figure/unnamed-chunk-7-1.png index 75884e2e..f39dac7e 100644 Binary files a/inst/vign/figure/unnamed-chunk-7-1.png and b/inst/vign/figure/unnamed-chunk-7-1.png differ diff --git a/inst/vign/figure/unnamed-chunk-8-1.png b/inst/vign/figure/unnamed-chunk-8-1.png index 1d439b6c..197d1fc8 100644 Binary files a/inst/vign/figure/unnamed-chunk-8-1.png and b/inst/vign/figure/unnamed-chunk-8-1.png differ diff --git a/inst/vign/homr_vignette.md b/inst/vign/homr_vignette.md index 4de6adbe..ee4e110d 100644 --- a/inst/vign/homr_vignette.md +++ b/inst/vign/homr_vignette.md @@ -194,7 +194,8 @@ names(res) #> [49] "30077988" "30079088" "30079240" "30082430" "30084216" "30084262" #> [55] "30084537" "30084796" "30094582" "30094639" "30094664" "30094670" #> [61] "30094683" "30094730" "30094806" "30094830" "30094917" "30094931" -#> [67] "30094936" +#> [67] "30094936" "30101120" "30101186" "30101294" "30101341" "30101363" +#> [73] "30101370" "30102005" ``` By country @@ -207,31 +208,32 @@ ldply(res, function(x) x$location$latlon) ``` ``` -#> .id latitude_dec longitude_dec date.beginDate date.endDate -#> 1 30095009 6.2 -2.333 Unknown Present -#> 2 30095161 6.083 -0.25 Unknown Present -#> 3 30095204 5.933 -0.983 Unknown Present -#> 4 30095262 9.033 -2.483 Unknown Present -#> 5 30095272 7.75 -2.1 Unknown Present -#> 6 30095306 10.083 -2.508 Unknown Present -#> 7 30095319 9.557 -0.863 Unknown Present -#> 8 30095440 5.783 0.633 Unknown Present -#> 9 30095471 4.867 -2.233 Unknown Present -#> 10 30095567 6.1 0.117 Unknown Present -#> 11 30095838 7.362 -2.329 Unknown Present -#> 12 30095905 5.617 0.0 Unknown Present -#> 13 30095956 10.9 -1.1 Unknown Present -#> 14 30096063 7.817 -0.033 Unknown Present -#> 15 30096177 6.6 0.467 Unknown Present -#> 16 30096242 5.605 -0.167 Unknown Present -#> 17 30096313 6.715 -1.591 Unknown Present -#> 18 30096407 4.896 -1.775 Unknown Present -#> 19 30096986 5.85 -0.1833 Unknown Present -#> 20 30097966 5.55 -0.2 Unknown Present -#> 21 30099309 9.4 -0.9 Unknown Present -#> 22 30100184 5.0 -2.0 Unknown Present -#> 23 30100285 6.47 0.33 Unknown Present -#> 24 30100821 8.2 0.57 Unknown Present +#> .id latitude_dec longitude_dec date.beginDate date.endDate +#> 1 30095009 6.2 -2.333 Unknown Present +#> 2 30095161 6.083 -0.25 Unknown Present +#> 3 30095204 5.933 -0.983 Unknown Present +#> 4 30095262 9.033 -2.483 Unknown Present +#> 5 30095272 7.75 -2.1 Unknown Present +#> 6 30095306 10.083 -2.508 Unknown Present +#> 7 30095319 9.557 -0.863 Unknown Present +#> 8 30095440 5.783 0.633 Unknown Present +#> 9 30095471 4.867 -2.233 Unknown Present +#> 10 30095567 6.1 0.117 Unknown Present +#> 11 30095838 7.362 -2.329 Unknown Present +#> 12 30095905 5.617 0.0 Unknown Present +#> 13 30095956 10.9 -1.1 Unknown Present +#> 14 30096063 7.817 -0.033 Unknown Present +#> 15 30096177 6.6 0.467 Unknown Present +#> 16 30096242 5.605 -0.167 Unknown Present +#> 17 30096313 6.715 -1.591 Unknown Present +#> 18 30096407 4.896 -1.775 Unknown Present +#> 19 30096986 5.85 -0.1833 Unknown Present +#> 20 30097966 5.55 -0.2 Unknown Present +#> 21 30099309 9.4 -0.9 Unknown Present +#> 22 30100184 5.0 -2.0 Unknown Present +#> 23 30100285 6.47 0.33 Unknown Present +#> 24 30100821 8.2 0.57 Unknown Present +#> 25 30104395 9.5 -0.85 1973-01-01T00:00:00.000 2008-12-31T00:00:00.000 ``` By state and county @@ -243,20 +245,13 @@ head( ldply(res, "[[", "head") ) ``` ``` -#> .id preferredName latitude_dec longitude_dec -#> 1 30061838 ASHEVILLE 4.2 ESE, NC 35.55 -82.48 -#> 2 30093502 ARDEN 2.8 WSW, NC 35.4589 -82.5652 -#> 3 20013818 BEETREE DAM 2, NC 35.63333 -82.4 -#> 4 20013838 BEETREE GAP, NC 35.7 -82.4 -#> 5 20013817 SWANNANOA 2 E, NC 35.6 -82.36667 -#> 6 30023671 SWANNANOA 2.7 NNW, NC 35.6365 -82.4141 -#> por.beginDate por.endDate precision -#> 1 Unknown Present -#> 2 Unknown Present -#> 3 1949-01-01T00:00:00.000 1962-03-31T00:00:00.000 DDMM -#> 4 1948-08-01T00:00:00.000 1950-12-31T00:00:00.000 DDMM -#> 5 1948-08-01T00:00:00.000 1987-08-26T00:00:00.000 DDMM -#> 6 Unknown Present +#> .id preferredName latitude_dec longitude_dec por.beginDate por.endDate precision +#> 1 30083542 BLACK MOUNTAIN 0.8 N, NC 35.6263 -82.3297 Unknown Present +#> 2 30077883 WEAVERVILLE 4.2 N, NC 35.7579 -82.5618 Unknown Present +#> 3 30029796 FAIRVIEW 1.2 S, NC 35.5058 -82.4051 Unknown Present +#> 4 30061838 ASHEVILLE 4.2 ESE, NC 35.55 -82.48 Unknown Present +#> 5 30093502 ARDEN 2.8 WSW, NC 35.4589 -82.5652 Unknown Present +#> 6 30103070 ASHEVILLE 1.1 NNE, NC 35.589 -82.5428 Unknown Present ``` ## Get header information only @@ -268,20 +263,13 @@ head( ldply(res, "[[", "head") ) ``` ``` -#> .id preferredName latitude_dec longitude_dec -#> 1 10001871 WILMINGTON NEW CASTLE CO AP, DE 39.6728 -75.6008 -#> 2 10013243 NEW CASTLE AAB, DE 39.68333 -75.58333 -#> 3 10100160 BRIDGEVILLE 1 NW, DE 38.75 -75.61667 -#> 4 10100161 GREENWOOD 2NE, DE 38.8161 -75.5761 -#> 5 10100162 DOVER, DE 39.1467 -75.5055 -#> 6 10100163 MILFORD 2 SE, DE 38.8983 -75.425 -#> precision por.beginDate por.endDate -#> 1 DDMMSS 1929-06-01T00:00:00.000 Present -#> 2 DDMM 1942-08-01T00:00:00.000 1957-07-31T00:00:00.000 -#> 3 DDMM 1890-01-01T00:00:00.000 1985-12-31T00:00:00.000 -#> 4 DDMMSS 1986-01-01T00:00:00.000 2010-08-04T00:00:00.000 -#> 5 DDMMSS 1870-07-01T00:00:00.000 Present -#> 6 DDMMSS 1857-12-01T00:00:00.000 2004-06-25T00:00:00.000 +#> .id preferredName latitude_dec longitude_dec precision por.beginDate por.endDate +#> 1 10001871 WILMINGTON NEW CASTLE CO AP, DE 39.6728 -75.6008 DDMMSS 1929-06-01T00:00:00.000 Present +#> 2 10013243 NEW CASTLE AAB, DE 39.68333 -75.58333 DDMM 1942-08-01T00:00:00.000 1957-07-31T00:00:00.000 +#> 3 10100160 BRIDGEVILLE 1 NW, DE 38.75 -75.61667 DDMM 1890-01-01T00:00:00.000 1985-12-31T00:00:00.000 +#> 4 10100161 GREENWOOD 2NE, DE 38.8161 -75.5761 DDMMSS 1986-01-01T00:00:00.000 2010-08-04T00:00:00.000 +#> 5 10100162 DOVER, DE 39.1467 -75.5055 DDMMSS 1870-07-01T00:00:00.000 Present +#> 6 10100163 MILFORD 2 SE, DE 38.8983 -75.425 DDMMSS 1857-12-01T00:00:00.000 2004-06-25T00:00:00.000 ``` ## Data definitions @@ -294,15 +282,25 @@ head( homr_definitions() ) ``` ``` -#> Source: local data frame [6 x 7] -#> #> defType abbr fullName displayName -#> (chr) (chr) (chr) (chr) #> 1 ids GHCND GHCND IDENTIFIER GHCND ID #> 2 ids COOP COOP NUMBER COOP ID #> 3 ids WBAN WBAN NUMBER WBAN ID #> 4 ids FAA FAA LOCATION IDENTIFIER FAA ID #> 5 ids ICAO ICAO ID ICAO ID #> 6 ids TRANS TRANSMITTAL ID Transmittal ID -#> Variables not shown: description (chr), cssaName (chr), ghcndName (chr) +#> description cssaName +#> 1 GLOBAL HISTORICAL CLIMATOLOGY NETWORK - DAILY (GHCND) IDENTIFIER +#> 2 NATIONAL WEATHER SERVICE COOPERATIVE NETWORK IDENTIFIER +#> 3 WEATHER-BUREAU-ARMY-NAVY IDENTIFIER +#> 4 FEDERAL AVIATION ADMINISTRATION IDENTIFIER +#> 5 INTERNATIONAL CIVIL AVIATION ORGANIZATION IDENTIFIER +#> 6 MISCELLANEOUS IDENTIFIER THAT DOES NOT FALL INTO AN OFFICIALLY SOURCED CATEGORY AND IS NEEDED IN SUPPORT OF NCDC DATA PRODUCTS AND INGEST +#> ghcndName +#> 1 +#> 2 +#> 3 +#> 4 +#> 5 +#> 6 ``` diff --git a/inst/vign/myfile.kmz b/inst/vign/myfile.kmz index 006523dc..1ba9f7a0 100644 Binary files a/inst/vign/myfile.kmz and b/inst/vign/myfile.kmz differ diff --git a/inst/vign/myfile.zip b/inst/vign/myfile.zip index 16f4767e..826ee66e 100644 Binary files a/inst/vign/myfile.zip and b/inst/vign/myfile.zip differ diff --git a/inst/vign/ncdc_vignette.Rmd b/inst/vign/ncdc_vignette.Rmd index 0ab30a3d..c0fd7ce2 100644 --- a/inst/vign/ncdc_vignette.Rmd +++ b/inst/vign/ncdc_vignette.Rmd @@ -81,13 +81,14 @@ ncdc_plot(out, breaks="1 month", dateformat="%d/%m") Search for data ```{r} -out2 <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', startdate = '2010-05-01', enddate = '2010-05-03', limit=100) +out <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', + startdate = '2010-05-01', enddate = '2010-10-31', limit=500) ``` Make a plot, with 6 hour breaks, and date format with only hour ```{r} -ncdc_plot(out2, breaks="6 hours", dateformat="%H") +ncdc_plot(out, breaks = "1 month", dateformat = "%d/%m") ``` ## Combine many calls to noaa function diff --git a/inst/vign/ncdc_vignette.md b/inst/vign/ncdc_vignette.md index ee5a029a..99ac882d 100644 --- a/inst/vign/ncdc_vignette.md +++ b/inst/vign/ncdc_vignette.md @@ -127,14 +127,15 @@ Search for data ```r -out2 <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', startdate = '2010-05-01', enddate = '2010-05-03', limit=100) +out <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', + startdate = '2010-05-01', enddate = '2010-10-31', limit=500) ``` Make a plot, with 6 hour breaks, and date format with only hour ```r -ncdc_plot(out2, breaks="6 hours", dateformat="%H") +ncdc_plot(out, breaks = "1 month", dateformat = "%d/%m") ``` ![plot of chunk unnamed-chunk-7](figure/unnamed-chunk-7-1.png) @@ -156,28 +157,34 @@ Then combine with a call to `ncdc_combine` ```r df <- ncdc_combine(out1, out2) head(df[[1]]); tail(df[[1]]) -#> Source: local data frame [6 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2010-03-01T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 2 2010-03-02T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 3 2010-03-03T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 4 2010-03-04T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 5 2010-03-05T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 6 2010-03-06T00:00:00 PRCP GHCND:USW00014895 0 0 -#> Variables not shown: fl_t (chr) -#> Source: local data frame [6 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2010-10-26T00:00:00 PRCP GHCND:USW00014895 221 0 -#> 2 2010-10-27T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 3 2010-10-28T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 4 2010-10-29T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 5 2010-10-30T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 6 2010-10-31T00:00:00 PRCP GHCND:USW00014895 0 0 -#> Variables not shown: fl_t (chr) +#> date datatype station value fl_m fl_q fl_so +#> 1 2010-03-01T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 2 2010-03-02T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 3 2010-03-03T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 4 2010-03-04T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 5 2010-03-05T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 6 2010-03-06T00:00:00 PRCP GHCND:USW00014895 0 0 +#> fl_t +#> 1 2400 +#> 2 2400 +#> 3 2400 +#> 4 2400 +#> 5 2400 +#> 6 2400 +#> date datatype station value fl_m fl_q fl_so +#> 148 2010-10-26T00:00:00 PRCP GHCND:USW00014895 221 0 +#> 149 2010-10-27T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 150 2010-10-28T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 151 2010-10-29T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 152 2010-10-30T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 153 2010-10-31T00:00:00 PRCP GHCND:USW00014895 0 0 +#> fl_t +#> 148 2400 +#> 149 2400 +#> 150 2400 +#> 151 2400 +#> 152 2400 +#> 153 2400 ``` Then plot - the default passing in the combined plot plots the data together. In this case it looks kind of weird since a straight line combines two distant dates. diff --git a/inst/vign/ncdc_workflow.md b/inst/vign/ncdc_workflow.md index 6a5a3cb9..baa9260a 100644 --- a/inst/vign/ncdc_workflow.md +++ b/inst/vign/ncdc_workflow.md @@ -72,12 +72,9 @@ ncdc_datacats(stationid = id) #> #> #> $data -#> Source: local data frame [2 x 2] -#> -#> name id -#> (chr) (chr) -#> 1 Computed COMP -#> 2 Precipitation PRCP +#> name id +#> 1 Computed COMP +#> 2 Precipitation PRCP #> #> attr(,"class") #> [1] "ncdc_datacats" @@ -93,20 +90,21 @@ ncdc_datasets(stationid = id) #> [1] 1 #> #> $meta$count -#> [1] 2 +#> [1] 3 #> #> $meta$limit #> [1] 25 #> #> #> $data -#> Source: local data frame [2 x 6] -#> -#> uid mindate maxdate name -#> (chr) (chr) (chr) (chr) -#> 1 gov.noaa.ncdc:C00861 1763-01-01 2016-01-17 Daily Summaries -#> 2 gov.noaa.ncdc:C00841 1763-01-01 2015-12-01 Monthly Summaries -#> Variables not shown: datacoverage (int), id (chr) +#> uid mindate maxdate name +#> 1 gov.noaa.ncdc:C00861 1763-01-01 2016-08-29 Daily Summaries +#> 2 gov.noaa.ncdc:C00841 1763-01-01 2016-03-01 Monthly Summaries +#> 3 gov.noaa.ncdc:C00946 1763-01-01 2016-07-01 Global Summary of the Month +#> datacoverage id +#> 1 1 GHCND +#> 2 1 GHCNDMS +#> 3 1 GSOM #> #> attr(,"class") #> [1] "ncdc_datasets" @@ -122,12 +120,9 @@ ncdc_datatypes(datasetid = "GHCND", stationid = id) #> 1 1 2 25 #> #> $data -#> Source: local data frame [2 x 5] -#> -#> mindate maxdate name datacoverage id -#> (chr) (chr) (chr) (int) (chr) -#> 1 1781-01-01 2016-01-17 Precipitation (tenths of mm) 1 PRCP -#> 2 1840-05-01 2016-01-16 Snowfall (mm) 1 SNOW +#> mindate maxdate name datacoverage id +#> 1 1781-01-01 2016-08-29 Precipitation 1 PRCP +#> 2 1840-05-01 2016-08-28 Snowfall 1 SNOW #> #> attr(,"class") #> [1] "ncdc_datatypes" @@ -160,22 +155,52 @@ ncdc(datasetid = "GHCND", stationid = id, datatypeid = "PRCP", startdate = "2012 #> #> #> $data -#> Source: local data frame [22 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2012-10-01T00:00:00 PRCP GHCND:US1FLCT0002 13 N -#> 2 2012-10-02T00:00:00 PRCP GHCND:US1FLCT0002 3 N -#> 3 2012-10-03T00:00:00 PRCP GHCND:US1FLCT0002 15 N -#> 4 2012-10-04T00:00:00 PRCP GHCND:US1FLCT0002 142 N -#> 5 2012-10-05T00:00:00 PRCP GHCND:US1FLCT0002 244 N -#> 6 2012-10-06T00:00:00 PRCP GHCND:US1FLCT0002 655 N -#> 7 2012-10-07T00:00:00 PRCP GHCND:US1FLCT0002 23 N -#> 8 2012-10-08T00:00:00 PRCP GHCND:US1FLCT0002 0 N -#> 9 2012-10-09T00:00:00 PRCP GHCND:US1FLCT0002 3 N -#> 10 2012-10-10T00:00:00 PRCP GHCND:US1FLCT0002 0 N -#> .. ... ... ... ... ... ... ... -#> Variables not shown: fl_t (chr) +#> date datatype station value fl_m fl_q fl_so +#> 1 2012-10-01T00:00:00 PRCP GHCND:US1FLCT0002 13 N +#> 2 2012-10-02T00:00:00 PRCP GHCND:US1FLCT0002 3 N +#> 3 2012-10-03T00:00:00 PRCP GHCND:US1FLCT0002 15 N +#> 4 2012-10-04T00:00:00 PRCP GHCND:US1FLCT0002 142 N +#> 5 2012-10-05T00:00:00 PRCP GHCND:US1FLCT0002 244 N +#> 6 2012-10-06T00:00:00 PRCP GHCND:US1FLCT0002 655 N +#> 7 2012-10-07T00:00:00 PRCP GHCND:US1FLCT0002 23 N +#> 8 2012-10-08T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 9 2012-10-09T00:00:00 PRCP GHCND:US1FLCT0002 3 N +#> 10 2012-10-10T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 11 2012-10-11T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 12 2012-10-12T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 13 2012-10-13T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 14 2012-10-14T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 15 2012-10-15T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 16 2012-10-16T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 17 2012-10-17T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 18 2012-10-18T00:00:00 PRCP GHCND:US1FLCT0002 0 T N +#> 19 2012-10-19T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 20 2012-10-20T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 21 2012-10-21T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 22 2012-10-24T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> fl_t +#> 1 +#> 2 +#> 3 +#> 4 +#> 5 +#> 6 +#> 7 +#> 8 +#> 9 +#> 10 +#> 11 +#> 12 +#> 13 +#> 14 +#> 15 +#> 16 +#> 17 +#> 18 +#> 19 +#> 20 +#> 21 +#> 22 #> #> attr(,"class") #> [1] "ncdc_data" diff --git a/inst/vign/seaice_vignette.md b/inst/vign/seaice_vignette.md index 7055a6bd..608eae08 100644 --- a/inst/vign/seaice_vignette.md +++ b/inst/vign/seaice_vignette.md @@ -42,8 +42,8 @@ head(out[[1]]) #> 1 -2125000 1950000 1 FALSE 1 0 0.1 #> 2 -2050000 1950000 2 FALSE 1 0 0.1 #> 3 -2050000 1925000 3 FALSE 1 0 0.1 -#> 4 -1950000 1925000 4 FALSE 1 0 0.1 -#> 5 -1950000 1900000 5 FALSE 1 0 0.1 +#> 4 -1925000 1925000 4 FALSE 1 0 0.1 +#> 5 -1925000 1900000 5 FALSE 1 0 0.1 #> 6 -1875000 1900000 6 FALSE 1 0 0.1 ``` diff --git a/inst/vign/swdi_vignette.md b/inst/vign/swdi_vignette.md index cc030e1e..7ef6d698 100644 --- a/inst/vign/swdi_vignette.md +++ b/inst/vign/swdi_vignette.md @@ -44,14 +44,11 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20060506') #> numeric(0) #> #> $meta$totalTimeInSeconds -#> [1] 0.368 +#> [1] 0.065 #> #> #> $data -#> Source: local data frame [25 x 8] -#> #> ztime wsr_id cell_id cell_type range azimuth max_shear -#> (chr) (chr) (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-05T00:05:50Z KBMX Q0 TVS 7 217 403 #> 2 2006-05-05T00:10:02Z KBMX Q0 TVS 5 208 421 #> 3 2006-05-05T00:12:34Z KSJT P2 TVS 49 106 17 @@ -62,8 +59,47 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20060506') #> 8 2006-05-05T00:37:37Z KMAF H4 TVS 50 334 34 #> 9 2006-05-05T00:41:51Z KMAF H4 TVS 51 335 29 #> 10 2006-05-05T00:44:33Z KLBB N0 TVS 46 245 35 -#> .. ... ... ... ... ... ... ... -#> Variables not shown: mxdv (chr) +#> 11 2006-05-05T00:46:03Z KMAF H4 TVS 49 335 41 +#> 12 2006-05-05T00:48:55Z KLBB N0 TVS 44 246 44 +#> 13 2006-05-05T00:50:16Z KMAF H4 TVS 49 337 33 +#> 14 2006-05-05T00:54:29Z KMAF H4 TVS 47 337 42 +#> 15 2006-05-05T00:57:42Z KLBB N0 TVS 41 251 46 +#> 16 2006-05-05T00:58:41Z KMAF H4 TVS 46 340 29 +#> 17 2006-05-05T01:02:04Z KLBB N0 TVS 39 251 42 +#> 18 2006-05-05T01:02:53Z KMAF H4 TVS 46 339 35 +#> 19 2006-05-05T01:02:53Z KMAF H4 TVS 50 338 27 +#> 20 2006-05-05T01:06:26Z KLBB N0 TVS 36 251 31 +#> 21 2006-05-05T01:07:06Z KMAF F5 TVS 45 342 44 +#> 22 2006-05-05T01:10:48Z KLBB N0 TVS 36 256 37 +#> 23 2006-05-05T01:11:18Z KMAF F5 TVS 45 343 39 +#> 24 2006-05-05T01:15:30Z KMAF F5 TVS 44 344 30 +#> 25 2006-05-05T01:15:30Z KMAF H4 TVS 49 341 26 +#> mxdv +#> 1 116 +#> 2 120 +#> 3 52 +#> 4 62 +#> 5 111 +#> 6 78 +#> 7 145 +#> 8 107 +#> 9 91 +#> 10 100 +#> 11 127 +#> 12 121 +#> 13 98 +#> 14 126 +#> 15 117 +#> 16 85 +#> 17 102 +#> 18 101 +#> 19 84 +#> 20 70 +#> 21 120 +#> 22 83 +#> 23 108 +#> 24 78 +#> 25 81 #> #> $shape #> shape @@ -108,21 +144,24 @@ list(out$meta, head(out$data), head(out$shape)) #> numeric(0) #> #> [[1]]$totalTimeInSeconds -#> [1] 3.908 +#> [1] 0.848 #> #> #> [[2]] -#> Source: local data frame [6 x 6] -#> #> ztime_start ztime_end id warningtype -#> (chr) (chr) (chr) (chr) #> 1 2006-05-05T22:53:00Z 2006-05-06T00:00:00Z 397428 SEVERE THUNDERSTORM #> 2 2006-05-05T22:55:00Z 2006-05-06T00:00:00Z 397429 SEVERE THUNDERSTORM #> 3 2006-05-05T22:55:00Z 2006-05-06T00:00:00Z 397430 SEVERE THUNDERSTORM #> 4 2006-05-05T22:57:00Z 2006-05-06T00:00:00Z 397431 SEVERE THUNDERSTORM #> 5 2006-05-05T23:03:00Z 2006-05-06T00:00:00Z 397434 SEVERE THUNDERSTORM #> 6 2006-05-05T23:14:00Z 2006-05-06T00:15:00Z 397437 SEVERE THUNDERSTORM -#> Variables not shown: issuewfo (chr), messageid (chr) +#> issuewfo messageid +#> 1 KLCH 052252 +#> 2 KLUB 052256 +#> 3 KLUB 052256 +#> 4 KMAF 052258 +#> 5 KMAF 052305 +#> 6 KLUB 052315 #> #> [[3]] #> shape @@ -148,16 +187,18 @@ swdi(dataset='plsr', startdate='20060505', enddate='20060510', bbox=c(-91,30,-90 #> #> #> $data -#> Source: local data frame [5 x 8] -#> #> ztime id event magnitude city -#> (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-09T02:20:00Z 427540 HAIL 1 5 E KENTWOOD #> 2 2006-05-09T02:40:00Z 427536 HAIL 1 MOUNT HERMAN #> 3 2006-05-09T02:40:00Z 427537 TSTM WND DMG -9999 MOUNT HERMAN #> 4 2006-05-09T03:00:00Z 427199 HAIL 0 FRANKLINTON #> 5 2006-05-09T03:17:00Z 427200 TORNADO -9999 5 S FRANKLINTON -#> Variables not shown: county (chr), state (chr), source (chr) +#> county state source +#> 1 TANGIPAHOA LA TRAINED SPOTTER +#> 2 WASHINGTON LA TRAINED SPOTTER +#> 3 WASHINGTON LA TRAINED SPOTTER +#> 4 WASHINGTON LA AMATEUR RADIO +#> 5 WASHINGTON LA LAW ENFORCEMENT #> #> $shape #> shape @@ -185,16 +226,18 @@ swdi(dataset='nx3tvs', startdate='20060506', enddate='20060507', tile=c(-102.12, #> #> #> $data -#> Source: local data frame [5 x 8] -#> #> ztime wsr_id cell_id cell_type range azimuth max_shear -#> (chr) (chr) (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-06T00:41:29Z KMAF D9 TVS 37 6 39 #> 2 2006-05-06T03:56:18Z KMAF N4 TVS 39 3 30 #> 3 2006-05-06T03:56:18Z KMAF N4 TVS 42 4 20 #> 4 2006-05-06T04:00:30Z KMAF N4 TVS 38 5 35 #> 5 2006-05-06T04:04:44Z KMAF N4 TVS 41 8 24 -#> Variables not shown: mxdv (chr) +#> mxdv +#> 1 85 +#> 2 73 +#> 3 52 +#> 4 86 +#> 5 62 #> #> $shape #> shape @@ -226,19 +269,16 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20090516', stat='tilesum:- #> numeric(0) #> #> $meta$totalTimeInSeconds -#> [1] 0.001 +#> [1] 0 #> #> #> $data -#> Source: local data frame [5 x 4] -#> #> day centerlat centerlon fcount -#> (chr) (chr) (chr) (chr) -#> 1 2009-04-11 32.7 -102 1 -#> 2 2007-09-07 32.7 -102 1 -#> 3 2007-03-29 32.7 -102 2 -#> 4 2008-06-20 32.7 -102 2 -#> 5 2008-05-27 32.7 -102 4 +#> 1 2007-09-07 32.7 -102 1 +#> 2 2007-03-29 32.7 -102 2 +#> 3 2008-05-27 32.7 -102 4 +#> 4 2009-04-11 32.7 -102 1 +#> 5 2008-06-20 32.7 -102 2 #> #> $shape #> shape diff --git a/vignettes/buoy_vignette.Rmd b/vignettes/buoy_vignette.Rmd index ae506d82..0786d1a4 100644 --- a/vignettes/buoy_vignette.Rmd +++ b/vignettes/buoy_vignette.Rmd @@ -73,18 +73,18 @@ buoy(dataset = 'cwind', buoyid = 46085) #> Dimensions (rows/cols): [33486 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2007-05-05T02:00:00Z 55.855 -142.559 331 2.8 -#> 2 2007-05-05T02:10:00Z 55.855 -142.559 328 2.6 -#> 3 2007-05-05T02:20:00Z 55.855 -142.559 329 2.2 -#> 4 2007-05-05T02:30:00Z 55.855 -142.559 356 2.1 -#> 5 2007-05-05T02:40:00Z 55.855 -142.559 360 1.5 -#> 6 2007-05-05T02:50:00Z 55.855 -142.559 10 1.9 -#> 7 2007-05-05T03:00:00Z 55.855 -142.559 10 2.2 -#> 8 2007-05-05T03:10:00Z 55.855 -142.559 14 2.2 -#> 9 2007-05-05T03:20:00Z 55.855 -142.559 16 2.1 -#> 10 2007-05-05T03:30:00Z 55.855 -142.559 22 1.6 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2007-05-05T02:00:00Z 55.855 -142.559 331 2.8 +#> 2 2007-05-05T02:10:00Z 55.855 -142.559 328 2.6 +#> 3 2007-05-05T02:20:00Z 55.855 -142.559 329 2.2 +#> 4 2007-05-05T02:30:00Z 55.855 -142.559 356 2.1 +#> 5 2007-05-05T02:40:00Z 55.855 -142.559 360 1.5 +#> 6 2007-05-05T02:50:00Z 55.855 -142.559 10 1.9 +#> 7 2007-05-05T03:00:00Z 55.855 -142.559 10 2.2 +#> 8 2007-05-05T03:10:00Z 55.855 -142.559 14 2.2 +#> 9 2007-05-05T03:20:00Z 55.855 -142.559 16 2.1 +#> 10 2007-05-05T03:30:00Z 55.855 -142.559 22 1.6 +#> .. ... ... ... ... ... ``` Including year @@ -98,18 +98,18 @@ buoy(dataset = 'cwind', buoyid = 41001, year = 1999) #> Dimensions (rows/cols): [52554 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 1999-01-01T00:00:00Z 34.68 -72.66 272 11.7 -#> 2 1999-01-01T00:10:00Z 34.68 -72.66 260 11.0 -#> 3 1999-01-01T00:20:00Z 34.68 -72.66 249 8.7 -#> 4 1999-01-01T00:30:00Z 34.68 -72.66 247 8.4 -#> 5 1999-01-01T00:40:00Z 34.68 -72.66 240 7.1 -#> 6 1999-01-01T00:50:00Z 34.68 -72.66 242 7.9 -#> 7 1999-01-01T01:00:00Z 34.68 -72.66 246 8.3 -#> 8 1999-01-01T01:10:00Z 34.68 -72.66 297 10.9 -#> 9 1999-01-01T01:20:00Z 34.68 -72.66 299 11.3 -#> 10 1999-01-01T01:30:00Z 34.68 -72.66 299 11.1 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 1999-01-01T00:00:00Z 34.68 -72.66 272 11.7 +#> 2 1999-01-01T00:10:00Z 34.68 -72.66 260 11.0 +#> 3 1999-01-01T00:20:00Z 34.68 -72.66 249 8.7 +#> 4 1999-01-01T00:30:00Z 34.68 -72.66 247 8.4 +#> 5 1999-01-01T00:40:00Z 34.68 -72.66 240 7.1 +#> 6 1999-01-01T00:50:00Z 34.68 -72.66 242 7.9 +#> 7 1999-01-01T01:00:00Z 34.68 -72.66 246 8.3 +#> 8 1999-01-01T01:10:00Z 34.68 -72.66 297 10.9 +#> 9 1999-01-01T01:20:00Z 34.68 -72.66 299 11.3 +#> 10 1999-01-01T01:30:00Z 34.68 -72.66 299 11.1 +#> .. ... ... ... ... ... ``` Including year and datatype @@ -123,18 +123,18 @@ buoy(dataset = 'cwind', buoyid = 41001, year = 2008, datatype = "cc") #> Dimensions (rows/cols): [1585 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 -#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 -#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 -#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 -#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 -#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 -#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 -#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 -#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 -#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 +#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 +#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 +#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 +#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 +#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 +#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 +#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 +#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 +#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 +#> .. ... ... ... ... ... ``` Including just datatype @@ -148,16 +148,16 @@ buoy(dataset = 'cwind', buoyid = 41001, datatype = "cc") #> Dimensions (rows/cols): [1585 X 5] #> 2 variables: [wind_dir, wind_spd] #> -#> time latitude longitude wind_dir wind_spd -#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 -#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 -#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 -#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 -#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 -#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 -#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 -#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 -#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 -#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 -#> .. ... ... ... ... ... +#> time lat lon wind_dir wind_spd +#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6 +#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7 +#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5 +#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8 +#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5 +#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9 +#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2 +#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2 +#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3 +#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8 +#> .. ... ... ... ... ... ``` diff --git a/vignettes/figure/seaice1-1.png b/vignettes/figure/seaice1-1.png index ef867c1e..c7be181b 100644 Binary files a/vignettes/figure/seaice1-1.png and b/vignettes/figure/seaice1-1.png differ diff --git a/vignettes/figure/seaice2-1.png b/vignettes/figure/seaice2-1.png index f90ef4d1..88df1702 100644 Binary files a/vignettes/figure/seaice2-1.png and b/vignettes/figure/seaice2-1.png differ diff --git a/vignettes/figure/unnamed-chunk-3-1.png b/vignettes/figure/unnamed-chunk-3-1.png index 938498ef..eb5302c9 100644 Binary files a/vignettes/figure/unnamed-chunk-3-1.png and b/vignettes/figure/unnamed-chunk-3-1.png differ diff --git a/vignettes/figure/unnamed-chunk-4-1.png b/vignettes/figure/unnamed-chunk-4-1.png index ee481dcd..a2c28a8d 100644 Binary files a/vignettes/figure/unnamed-chunk-4-1.png and b/vignettes/figure/unnamed-chunk-4-1.png differ diff --git a/vignettes/figure/unnamed-chunk-7-1.png b/vignettes/figure/unnamed-chunk-7-1.png index 75884e2e..f39dac7e 100644 Binary files a/vignettes/figure/unnamed-chunk-7-1.png and b/vignettes/figure/unnamed-chunk-7-1.png differ diff --git a/vignettes/figure/unnamed-chunk-8-1.png b/vignettes/figure/unnamed-chunk-8-1.png index 1d439b6c..197d1fc8 100644 Binary files a/vignettes/figure/unnamed-chunk-8-1.png and b/vignettes/figure/unnamed-chunk-8-1.png differ diff --git a/vignettes/homr_vignette.Rmd b/vignettes/homr_vignette.Rmd index 4de6adbe..ee4e110d 100644 --- a/vignettes/homr_vignette.Rmd +++ b/vignettes/homr_vignette.Rmd @@ -194,7 +194,8 @@ names(res) #> [49] "30077988" "30079088" "30079240" "30082430" "30084216" "30084262" #> [55] "30084537" "30084796" "30094582" "30094639" "30094664" "30094670" #> [61] "30094683" "30094730" "30094806" "30094830" "30094917" "30094931" -#> [67] "30094936" +#> [67] "30094936" "30101120" "30101186" "30101294" "30101341" "30101363" +#> [73] "30101370" "30102005" ``` By country @@ -207,31 +208,32 @@ ldply(res, function(x) x$location$latlon) ``` ``` -#> .id latitude_dec longitude_dec date.beginDate date.endDate -#> 1 30095009 6.2 -2.333 Unknown Present -#> 2 30095161 6.083 -0.25 Unknown Present -#> 3 30095204 5.933 -0.983 Unknown Present -#> 4 30095262 9.033 -2.483 Unknown Present -#> 5 30095272 7.75 -2.1 Unknown Present -#> 6 30095306 10.083 -2.508 Unknown Present -#> 7 30095319 9.557 -0.863 Unknown Present -#> 8 30095440 5.783 0.633 Unknown Present -#> 9 30095471 4.867 -2.233 Unknown Present -#> 10 30095567 6.1 0.117 Unknown Present -#> 11 30095838 7.362 -2.329 Unknown Present -#> 12 30095905 5.617 0.0 Unknown Present -#> 13 30095956 10.9 -1.1 Unknown Present -#> 14 30096063 7.817 -0.033 Unknown Present -#> 15 30096177 6.6 0.467 Unknown Present -#> 16 30096242 5.605 -0.167 Unknown Present -#> 17 30096313 6.715 -1.591 Unknown Present -#> 18 30096407 4.896 -1.775 Unknown Present -#> 19 30096986 5.85 -0.1833 Unknown Present -#> 20 30097966 5.55 -0.2 Unknown Present -#> 21 30099309 9.4 -0.9 Unknown Present -#> 22 30100184 5.0 -2.0 Unknown Present -#> 23 30100285 6.47 0.33 Unknown Present -#> 24 30100821 8.2 0.57 Unknown Present +#> .id latitude_dec longitude_dec date.beginDate date.endDate +#> 1 30095009 6.2 -2.333 Unknown Present +#> 2 30095161 6.083 -0.25 Unknown Present +#> 3 30095204 5.933 -0.983 Unknown Present +#> 4 30095262 9.033 -2.483 Unknown Present +#> 5 30095272 7.75 -2.1 Unknown Present +#> 6 30095306 10.083 -2.508 Unknown Present +#> 7 30095319 9.557 -0.863 Unknown Present +#> 8 30095440 5.783 0.633 Unknown Present +#> 9 30095471 4.867 -2.233 Unknown Present +#> 10 30095567 6.1 0.117 Unknown Present +#> 11 30095838 7.362 -2.329 Unknown Present +#> 12 30095905 5.617 0.0 Unknown Present +#> 13 30095956 10.9 -1.1 Unknown Present +#> 14 30096063 7.817 -0.033 Unknown Present +#> 15 30096177 6.6 0.467 Unknown Present +#> 16 30096242 5.605 -0.167 Unknown Present +#> 17 30096313 6.715 -1.591 Unknown Present +#> 18 30096407 4.896 -1.775 Unknown Present +#> 19 30096986 5.85 -0.1833 Unknown Present +#> 20 30097966 5.55 -0.2 Unknown Present +#> 21 30099309 9.4 -0.9 Unknown Present +#> 22 30100184 5.0 -2.0 Unknown Present +#> 23 30100285 6.47 0.33 Unknown Present +#> 24 30100821 8.2 0.57 Unknown Present +#> 25 30104395 9.5 -0.85 1973-01-01T00:00:00.000 2008-12-31T00:00:00.000 ``` By state and county @@ -243,20 +245,13 @@ head( ldply(res, "[[", "head") ) ``` ``` -#> .id preferredName latitude_dec longitude_dec -#> 1 30061838 ASHEVILLE 4.2 ESE, NC 35.55 -82.48 -#> 2 30093502 ARDEN 2.8 WSW, NC 35.4589 -82.5652 -#> 3 20013818 BEETREE DAM 2, NC 35.63333 -82.4 -#> 4 20013838 BEETREE GAP, NC 35.7 -82.4 -#> 5 20013817 SWANNANOA 2 E, NC 35.6 -82.36667 -#> 6 30023671 SWANNANOA 2.7 NNW, NC 35.6365 -82.4141 -#> por.beginDate por.endDate precision -#> 1 Unknown Present -#> 2 Unknown Present -#> 3 1949-01-01T00:00:00.000 1962-03-31T00:00:00.000 DDMM -#> 4 1948-08-01T00:00:00.000 1950-12-31T00:00:00.000 DDMM -#> 5 1948-08-01T00:00:00.000 1987-08-26T00:00:00.000 DDMM -#> 6 Unknown Present +#> .id preferredName latitude_dec longitude_dec por.beginDate por.endDate precision +#> 1 30083542 BLACK MOUNTAIN 0.8 N, NC 35.6263 -82.3297 Unknown Present +#> 2 30077883 WEAVERVILLE 4.2 N, NC 35.7579 -82.5618 Unknown Present +#> 3 30029796 FAIRVIEW 1.2 S, NC 35.5058 -82.4051 Unknown Present +#> 4 30061838 ASHEVILLE 4.2 ESE, NC 35.55 -82.48 Unknown Present +#> 5 30093502 ARDEN 2.8 WSW, NC 35.4589 -82.5652 Unknown Present +#> 6 30103070 ASHEVILLE 1.1 NNE, NC 35.589 -82.5428 Unknown Present ``` ## Get header information only @@ -268,20 +263,13 @@ head( ldply(res, "[[", "head") ) ``` ``` -#> .id preferredName latitude_dec longitude_dec -#> 1 10001871 WILMINGTON NEW CASTLE CO AP, DE 39.6728 -75.6008 -#> 2 10013243 NEW CASTLE AAB, DE 39.68333 -75.58333 -#> 3 10100160 BRIDGEVILLE 1 NW, DE 38.75 -75.61667 -#> 4 10100161 GREENWOOD 2NE, DE 38.8161 -75.5761 -#> 5 10100162 DOVER, DE 39.1467 -75.5055 -#> 6 10100163 MILFORD 2 SE, DE 38.8983 -75.425 -#> precision por.beginDate por.endDate -#> 1 DDMMSS 1929-06-01T00:00:00.000 Present -#> 2 DDMM 1942-08-01T00:00:00.000 1957-07-31T00:00:00.000 -#> 3 DDMM 1890-01-01T00:00:00.000 1985-12-31T00:00:00.000 -#> 4 DDMMSS 1986-01-01T00:00:00.000 2010-08-04T00:00:00.000 -#> 5 DDMMSS 1870-07-01T00:00:00.000 Present -#> 6 DDMMSS 1857-12-01T00:00:00.000 2004-06-25T00:00:00.000 +#> .id preferredName latitude_dec longitude_dec precision por.beginDate por.endDate +#> 1 10001871 WILMINGTON NEW CASTLE CO AP, DE 39.6728 -75.6008 DDMMSS 1929-06-01T00:00:00.000 Present +#> 2 10013243 NEW CASTLE AAB, DE 39.68333 -75.58333 DDMM 1942-08-01T00:00:00.000 1957-07-31T00:00:00.000 +#> 3 10100160 BRIDGEVILLE 1 NW, DE 38.75 -75.61667 DDMM 1890-01-01T00:00:00.000 1985-12-31T00:00:00.000 +#> 4 10100161 GREENWOOD 2NE, DE 38.8161 -75.5761 DDMMSS 1986-01-01T00:00:00.000 2010-08-04T00:00:00.000 +#> 5 10100162 DOVER, DE 39.1467 -75.5055 DDMMSS 1870-07-01T00:00:00.000 Present +#> 6 10100163 MILFORD 2 SE, DE 38.8983 -75.425 DDMMSS 1857-12-01T00:00:00.000 2004-06-25T00:00:00.000 ``` ## Data definitions @@ -294,15 +282,25 @@ head( homr_definitions() ) ``` ``` -#> Source: local data frame [6 x 7] -#> #> defType abbr fullName displayName -#> (chr) (chr) (chr) (chr) #> 1 ids GHCND GHCND IDENTIFIER GHCND ID #> 2 ids COOP COOP NUMBER COOP ID #> 3 ids WBAN WBAN NUMBER WBAN ID #> 4 ids FAA FAA LOCATION IDENTIFIER FAA ID #> 5 ids ICAO ICAO ID ICAO ID #> 6 ids TRANS TRANSMITTAL ID Transmittal ID -#> Variables not shown: description (chr), cssaName (chr), ghcndName (chr) +#> description cssaName +#> 1 GLOBAL HISTORICAL CLIMATOLOGY NETWORK - DAILY (GHCND) IDENTIFIER +#> 2 NATIONAL WEATHER SERVICE COOPERATIVE NETWORK IDENTIFIER +#> 3 WEATHER-BUREAU-ARMY-NAVY IDENTIFIER +#> 4 FEDERAL AVIATION ADMINISTRATION IDENTIFIER +#> 5 INTERNATIONAL CIVIL AVIATION ORGANIZATION IDENTIFIER +#> 6 MISCELLANEOUS IDENTIFIER THAT DOES NOT FALL INTO AN OFFICIALLY SOURCED CATEGORY AND IS NEEDED IN SUPPORT OF NCDC DATA PRODUCTS AND INGEST +#> ghcndName +#> 1 +#> 2 +#> 3 +#> 4 +#> 5 +#> 6 ``` diff --git a/vignettes/ncdc_vignette.Rmd b/vignettes/ncdc_vignette.Rmd index ee5a029a..99ac882d 100644 --- a/vignettes/ncdc_vignette.Rmd +++ b/vignettes/ncdc_vignette.Rmd @@ -127,14 +127,15 @@ Search for data ```r -out2 <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', startdate = '2010-05-01', enddate = '2010-05-03', limit=100) +out <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP', + startdate = '2010-05-01', enddate = '2010-10-31', limit=500) ``` Make a plot, with 6 hour breaks, and date format with only hour ```r -ncdc_plot(out2, breaks="6 hours", dateformat="%H") +ncdc_plot(out, breaks = "1 month", dateformat = "%d/%m") ``` ![plot of chunk unnamed-chunk-7](figure/unnamed-chunk-7-1.png) @@ -156,28 +157,34 @@ Then combine with a call to `ncdc_combine` ```r df <- ncdc_combine(out1, out2) head(df[[1]]); tail(df[[1]]) -#> Source: local data frame [6 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2010-03-01T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 2 2010-03-02T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 3 2010-03-03T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 4 2010-03-04T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 5 2010-03-05T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 6 2010-03-06T00:00:00 PRCP GHCND:USW00014895 0 0 -#> Variables not shown: fl_t (chr) -#> Source: local data frame [6 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2010-10-26T00:00:00 PRCP GHCND:USW00014895 221 0 -#> 2 2010-10-27T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 3 2010-10-28T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 4 2010-10-29T00:00:00 PRCP GHCND:USW00014895 0 T 0 -#> 5 2010-10-30T00:00:00 PRCP GHCND:USW00014895 0 0 -#> 6 2010-10-31T00:00:00 PRCP GHCND:USW00014895 0 0 -#> Variables not shown: fl_t (chr) +#> date datatype station value fl_m fl_q fl_so +#> 1 2010-03-01T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 2 2010-03-02T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 3 2010-03-03T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 4 2010-03-04T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 5 2010-03-05T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 6 2010-03-06T00:00:00 PRCP GHCND:USW00014895 0 0 +#> fl_t +#> 1 2400 +#> 2 2400 +#> 3 2400 +#> 4 2400 +#> 5 2400 +#> 6 2400 +#> date datatype station value fl_m fl_q fl_so +#> 148 2010-10-26T00:00:00 PRCP GHCND:USW00014895 221 0 +#> 149 2010-10-27T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 150 2010-10-28T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 151 2010-10-29T00:00:00 PRCP GHCND:USW00014895 0 T 0 +#> 152 2010-10-30T00:00:00 PRCP GHCND:USW00014895 0 0 +#> 153 2010-10-31T00:00:00 PRCP GHCND:USW00014895 0 0 +#> fl_t +#> 148 2400 +#> 149 2400 +#> 150 2400 +#> 151 2400 +#> 152 2400 +#> 153 2400 ``` Then plot - the default passing in the combined plot plots the data together. In this case it looks kind of weird since a straight line combines two distant dates. diff --git a/vignettes/ncdc_workflow.Rmd b/vignettes/ncdc_workflow.Rmd index 6a5a3cb9..baa9260a 100644 --- a/vignettes/ncdc_workflow.Rmd +++ b/vignettes/ncdc_workflow.Rmd @@ -72,12 +72,9 @@ ncdc_datacats(stationid = id) #> #> #> $data -#> Source: local data frame [2 x 2] -#> -#> name id -#> (chr) (chr) -#> 1 Computed COMP -#> 2 Precipitation PRCP +#> name id +#> 1 Computed COMP +#> 2 Precipitation PRCP #> #> attr(,"class") #> [1] "ncdc_datacats" @@ -93,20 +90,21 @@ ncdc_datasets(stationid = id) #> [1] 1 #> #> $meta$count -#> [1] 2 +#> [1] 3 #> #> $meta$limit #> [1] 25 #> #> #> $data -#> Source: local data frame [2 x 6] -#> -#> uid mindate maxdate name -#> (chr) (chr) (chr) (chr) -#> 1 gov.noaa.ncdc:C00861 1763-01-01 2016-01-17 Daily Summaries -#> 2 gov.noaa.ncdc:C00841 1763-01-01 2015-12-01 Monthly Summaries -#> Variables not shown: datacoverage (int), id (chr) +#> uid mindate maxdate name +#> 1 gov.noaa.ncdc:C00861 1763-01-01 2016-08-29 Daily Summaries +#> 2 gov.noaa.ncdc:C00841 1763-01-01 2016-03-01 Monthly Summaries +#> 3 gov.noaa.ncdc:C00946 1763-01-01 2016-07-01 Global Summary of the Month +#> datacoverage id +#> 1 1 GHCND +#> 2 1 GHCNDMS +#> 3 1 GSOM #> #> attr(,"class") #> [1] "ncdc_datasets" @@ -122,12 +120,9 @@ ncdc_datatypes(datasetid = "GHCND", stationid = id) #> 1 1 2 25 #> #> $data -#> Source: local data frame [2 x 5] -#> -#> mindate maxdate name datacoverage id -#> (chr) (chr) (chr) (int) (chr) -#> 1 1781-01-01 2016-01-17 Precipitation (tenths of mm) 1 PRCP -#> 2 1840-05-01 2016-01-16 Snowfall (mm) 1 SNOW +#> mindate maxdate name datacoverage id +#> 1 1781-01-01 2016-08-29 Precipitation 1 PRCP +#> 2 1840-05-01 2016-08-28 Snowfall 1 SNOW #> #> attr(,"class") #> [1] "ncdc_datatypes" @@ -160,22 +155,52 @@ ncdc(datasetid = "GHCND", stationid = id, datatypeid = "PRCP", startdate = "2012 #> #> #> $data -#> Source: local data frame [22 x 8] -#> -#> date datatype station value fl_m fl_q fl_so -#> (chr) (chr) (chr) (int) (chr) (chr) (chr) -#> 1 2012-10-01T00:00:00 PRCP GHCND:US1FLCT0002 13 N -#> 2 2012-10-02T00:00:00 PRCP GHCND:US1FLCT0002 3 N -#> 3 2012-10-03T00:00:00 PRCP GHCND:US1FLCT0002 15 N -#> 4 2012-10-04T00:00:00 PRCP GHCND:US1FLCT0002 142 N -#> 5 2012-10-05T00:00:00 PRCP GHCND:US1FLCT0002 244 N -#> 6 2012-10-06T00:00:00 PRCP GHCND:US1FLCT0002 655 N -#> 7 2012-10-07T00:00:00 PRCP GHCND:US1FLCT0002 23 N -#> 8 2012-10-08T00:00:00 PRCP GHCND:US1FLCT0002 0 N -#> 9 2012-10-09T00:00:00 PRCP GHCND:US1FLCT0002 3 N -#> 10 2012-10-10T00:00:00 PRCP GHCND:US1FLCT0002 0 N -#> .. ... ... ... ... ... ... ... -#> Variables not shown: fl_t (chr) +#> date datatype station value fl_m fl_q fl_so +#> 1 2012-10-01T00:00:00 PRCP GHCND:US1FLCT0002 13 N +#> 2 2012-10-02T00:00:00 PRCP GHCND:US1FLCT0002 3 N +#> 3 2012-10-03T00:00:00 PRCP GHCND:US1FLCT0002 15 N +#> 4 2012-10-04T00:00:00 PRCP GHCND:US1FLCT0002 142 N +#> 5 2012-10-05T00:00:00 PRCP GHCND:US1FLCT0002 244 N +#> 6 2012-10-06T00:00:00 PRCP GHCND:US1FLCT0002 655 N +#> 7 2012-10-07T00:00:00 PRCP GHCND:US1FLCT0002 23 N +#> 8 2012-10-08T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 9 2012-10-09T00:00:00 PRCP GHCND:US1FLCT0002 3 N +#> 10 2012-10-10T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 11 2012-10-11T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 12 2012-10-12T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 13 2012-10-13T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 14 2012-10-14T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 15 2012-10-15T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 16 2012-10-16T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 17 2012-10-17T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 18 2012-10-18T00:00:00 PRCP GHCND:US1FLCT0002 0 T N +#> 19 2012-10-19T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 20 2012-10-20T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 21 2012-10-21T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> 22 2012-10-24T00:00:00 PRCP GHCND:US1FLCT0002 0 N +#> fl_t +#> 1 +#> 2 +#> 3 +#> 4 +#> 5 +#> 6 +#> 7 +#> 8 +#> 9 +#> 10 +#> 11 +#> 12 +#> 13 +#> 14 +#> 15 +#> 16 +#> 17 +#> 18 +#> 19 +#> 20 +#> 21 +#> 22 #> #> attr(,"class") #> [1] "ncdc_data" diff --git a/vignettes/seaice_vignette.Rmd b/vignettes/seaice_vignette.Rmd index 7055a6bd..608eae08 100644 --- a/vignettes/seaice_vignette.Rmd +++ b/vignettes/seaice_vignette.Rmd @@ -42,8 +42,8 @@ head(out[[1]]) #> 1 -2125000 1950000 1 FALSE 1 0 0.1 #> 2 -2050000 1950000 2 FALSE 1 0 0.1 #> 3 -2050000 1925000 3 FALSE 1 0 0.1 -#> 4 -1950000 1925000 4 FALSE 1 0 0.1 -#> 5 -1950000 1900000 5 FALSE 1 0 0.1 +#> 4 -1925000 1925000 4 FALSE 1 0 0.1 +#> 5 -1925000 1900000 5 FALSE 1 0 0.1 #> 6 -1875000 1900000 6 FALSE 1 0 0.1 ``` diff --git a/vignettes/swdi_vignette.Rmd b/vignettes/swdi_vignette.Rmd index cc030e1e..7ef6d698 100644 --- a/vignettes/swdi_vignette.Rmd +++ b/vignettes/swdi_vignette.Rmd @@ -44,14 +44,11 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20060506') #> numeric(0) #> #> $meta$totalTimeInSeconds -#> [1] 0.368 +#> [1] 0.065 #> #> #> $data -#> Source: local data frame [25 x 8] -#> #> ztime wsr_id cell_id cell_type range azimuth max_shear -#> (chr) (chr) (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-05T00:05:50Z KBMX Q0 TVS 7 217 403 #> 2 2006-05-05T00:10:02Z KBMX Q0 TVS 5 208 421 #> 3 2006-05-05T00:12:34Z KSJT P2 TVS 49 106 17 @@ -62,8 +59,47 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20060506') #> 8 2006-05-05T00:37:37Z KMAF H4 TVS 50 334 34 #> 9 2006-05-05T00:41:51Z KMAF H4 TVS 51 335 29 #> 10 2006-05-05T00:44:33Z KLBB N0 TVS 46 245 35 -#> .. ... ... ... ... ... ... ... -#> Variables not shown: mxdv (chr) +#> 11 2006-05-05T00:46:03Z KMAF H4 TVS 49 335 41 +#> 12 2006-05-05T00:48:55Z KLBB N0 TVS 44 246 44 +#> 13 2006-05-05T00:50:16Z KMAF H4 TVS 49 337 33 +#> 14 2006-05-05T00:54:29Z KMAF H4 TVS 47 337 42 +#> 15 2006-05-05T00:57:42Z KLBB N0 TVS 41 251 46 +#> 16 2006-05-05T00:58:41Z KMAF H4 TVS 46 340 29 +#> 17 2006-05-05T01:02:04Z KLBB N0 TVS 39 251 42 +#> 18 2006-05-05T01:02:53Z KMAF H4 TVS 46 339 35 +#> 19 2006-05-05T01:02:53Z KMAF H4 TVS 50 338 27 +#> 20 2006-05-05T01:06:26Z KLBB N0 TVS 36 251 31 +#> 21 2006-05-05T01:07:06Z KMAF F5 TVS 45 342 44 +#> 22 2006-05-05T01:10:48Z KLBB N0 TVS 36 256 37 +#> 23 2006-05-05T01:11:18Z KMAF F5 TVS 45 343 39 +#> 24 2006-05-05T01:15:30Z KMAF F5 TVS 44 344 30 +#> 25 2006-05-05T01:15:30Z KMAF H4 TVS 49 341 26 +#> mxdv +#> 1 116 +#> 2 120 +#> 3 52 +#> 4 62 +#> 5 111 +#> 6 78 +#> 7 145 +#> 8 107 +#> 9 91 +#> 10 100 +#> 11 127 +#> 12 121 +#> 13 98 +#> 14 126 +#> 15 117 +#> 16 85 +#> 17 102 +#> 18 101 +#> 19 84 +#> 20 70 +#> 21 120 +#> 22 83 +#> 23 108 +#> 24 78 +#> 25 81 #> #> $shape #> shape @@ -108,21 +144,24 @@ list(out$meta, head(out$data), head(out$shape)) #> numeric(0) #> #> [[1]]$totalTimeInSeconds -#> [1] 3.908 +#> [1] 0.848 #> #> #> [[2]] -#> Source: local data frame [6 x 6] -#> #> ztime_start ztime_end id warningtype -#> (chr) (chr) (chr) (chr) #> 1 2006-05-05T22:53:00Z 2006-05-06T00:00:00Z 397428 SEVERE THUNDERSTORM #> 2 2006-05-05T22:55:00Z 2006-05-06T00:00:00Z 397429 SEVERE THUNDERSTORM #> 3 2006-05-05T22:55:00Z 2006-05-06T00:00:00Z 397430 SEVERE THUNDERSTORM #> 4 2006-05-05T22:57:00Z 2006-05-06T00:00:00Z 397431 SEVERE THUNDERSTORM #> 5 2006-05-05T23:03:00Z 2006-05-06T00:00:00Z 397434 SEVERE THUNDERSTORM #> 6 2006-05-05T23:14:00Z 2006-05-06T00:15:00Z 397437 SEVERE THUNDERSTORM -#> Variables not shown: issuewfo (chr), messageid (chr) +#> issuewfo messageid +#> 1 KLCH 052252 +#> 2 KLUB 052256 +#> 3 KLUB 052256 +#> 4 KMAF 052258 +#> 5 KMAF 052305 +#> 6 KLUB 052315 #> #> [[3]] #> shape @@ -148,16 +187,18 @@ swdi(dataset='plsr', startdate='20060505', enddate='20060510', bbox=c(-91,30,-90 #> #> #> $data -#> Source: local data frame [5 x 8] -#> #> ztime id event magnitude city -#> (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-09T02:20:00Z 427540 HAIL 1 5 E KENTWOOD #> 2 2006-05-09T02:40:00Z 427536 HAIL 1 MOUNT HERMAN #> 3 2006-05-09T02:40:00Z 427537 TSTM WND DMG -9999 MOUNT HERMAN #> 4 2006-05-09T03:00:00Z 427199 HAIL 0 FRANKLINTON #> 5 2006-05-09T03:17:00Z 427200 TORNADO -9999 5 S FRANKLINTON -#> Variables not shown: county (chr), state (chr), source (chr) +#> county state source +#> 1 TANGIPAHOA LA TRAINED SPOTTER +#> 2 WASHINGTON LA TRAINED SPOTTER +#> 3 WASHINGTON LA TRAINED SPOTTER +#> 4 WASHINGTON LA AMATEUR RADIO +#> 5 WASHINGTON LA LAW ENFORCEMENT #> #> $shape #> shape @@ -185,16 +226,18 @@ swdi(dataset='nx3tvs', startdate='20060506', enddate='20060507', tile=c(-102.12, #> #> #> $data -#> Source: local data frame [5 x 8] -#> #> ztime wsr_id cell_id cell_type range azimuth max_shear -#> (chr) (chr) (chr) (chr) (chr) (chr) (chr) #> 1 2006-05-06T00:41:29Z KMAF D9 TVS 37 6 39 #> 2 2006-05-06T03:56:18Z KMAF N4 TVS 39 3 30 #> 3 2006-05-06T03:56:18Z KMAF N4 TVS 42 4 20 #> 4 2006-05-06T04:00:30Z KMAF N4 TVS 38 5 35 #> 5 2006-05-06T04:04:44Z KMAF N4 TVS 41 8 24 -#> Variables not shown: mxdv (chr) +#> mxdv +#> 1 85 +#> 2 73 +#> 3 52 +#> 4 86 +#> 5 62 #> #> $shape #> shape @@ -226,19 +269,16 @@ swdi(dataset='nx3tvs', startdate='20060505', enddate='20090516', stat='tilesum:- #> numeric(0) #> #> $meta$totalTimeInSeconds -#> [1] 0.001 +#> [1] 0 #> #> #> $data -#> Source: local data frame [5 x 4] -#> #> day centerlat centerlon fcount -#> (chr) (chr) (chr) (chr) -#> 1 2009-04-11 32.7 -102 1 -#> 2 2007-09-07 32.7 -102 1 -#> 3 2007-03-29 32.7 -102 2 -#> 4 2008-06-20 32.7 -102 2 -#> 5 2008-05-27 32.7 -102 4 +#> 1 2007-09-07 32.7 -102 1 +#> 2 2007-03-29 32.7 -102 2 +#> 3 2008-05-27 32.7 -102 4 +#> 4 2009-04-11 32.7 -102 1 +#> 5 2008-06-20 32.7 -102 2 #> #> $shape #> shape