diff --git a/.circleci/config.yml b/.circleci/config.yml index 81b63640..9e44b0b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,9 +17,11 @@ jobs: command: | R -e "devtools::install_deps(dependencies = TRUE)" R -e "devtools::install_github('MangoTheCat/goodpractice')" + no_output_timeout: 30m - run: command: | - R -e "devtools::check()" + R -e "devtools::check(run_dont_test = TRUE)" + no_output_timeout: 30m - save_cache: key: deps1-{{ .Branch }}-{{ checksum "DESCRIPTION" }}-{{ checksum ".circleci/config.yml" }} paths: @@ -31,6 +33,7 @@ jobs: R -e "goodpractice::gp(checks = grep('(rcmdcheck|covr)', goodpractice::all_checks(), invert=TRUE, value=TRUE))" R -e "cv <- covr::package_coverage(); print(cv); covr::report(x = cv, file = '/root/main/artifacts/gsodr-coverage.html', browse=FALSE)" R CMD Rd2pdf --force --output='/root/main/artifacts/gsodr-manual.pdf' . + no_output_timeout: 30m - store_artifacts: path: /root/main/artifacts/ destination: artifacts diff --git a/DESCRIPTION b/DESCRIPTION index 95b86687..6fda6c39 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: GSODR Type: Package Title: Global Surface Summary of the Day ('GSOD') Weather Data Client -Version: 1.3.0 +Version: 1.3.1 Authors@R: c(person("Adam", "Sparks", role = c("aut", "cre"), email = "adamhsparks@gmail.com", comment = c(ORCID = "0000-0002-0061-8359")), diff --git a/NEWS.md b/NEWS.md index 3f2a7d38..7c10d0b5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# GSODR 1.3.1 + +## Bug fixes + +- Fix examples that did not run properly + +## Minor changes + +- Update internal database of station locations + # GSODR 1.3.0 ## New Functionality @@ -10,10 +20,10 @@ ## Bug fixes - Refactor internal functionality to be more clear and efficient in execution - + - `country-list` is not loaded unless user has specified a country in `get_GSOD()` - + - An instance where the FIPS code was determined twice was removed - Replace `\dontrun{}` with `\donttest{}` in documentation examples @@ -28,19 +38,19 @@ - Store internal database of station locations fields `BEGIN` and `END` as integer, not double - + - Clarify code of conduct statement in README that it only applies to this, GSODR, project - + - Prompt user for input with warning about reproducibility if using the `update_station_list()` function - Adds metadata header to the `tibble` returned by `get_inventory()` - Remove startup message to conform with rOpenSci guidelines - + - Remove extra code, clean up code-chunks and use `hrbrthemes::theme_ipsum()` - for + for [data-raw/fetch_isd-history.md](https://github.com/ropensci/GSODR/blob/master/data-raw/fetch_isd-history.md) -------------------------------------------------------------------------------- diff --git a/R/get_GSOD.R b/R/get_GSOD.R index 6e1da0f2..284d708d 100644 --- a/R/get_GSOD.R +++ b/R/get_GSOD.R @@ -11,7 +11,7 @@ #' #' Parallel processing can be enabled using \code{\link[future]{plan}} to set #' up a parallel backend of your choice, e.g., -#' \code{future::plan(multisession)}. See examples for more. +#' \code{future::plan("multisession")}. See examples for more. #' #' @details #' Stations reporting a latitude of < -90 or > 90 or longitude of < -180 or > @@ -85,7 +85,7 @@ #' AUS #' #' # Download agroclimatology data for 2015 using parallel processing -#' future::plan(multisession) +#' future::plan("multisession") #' ag <- get_GSOD(years = 2015, agroclimatology = TRUE) #' #' ag @@ -93,7 +93,7 @@ #' # Download global data for 2010 to 2015 with a maximum allowed 5 missing days #' # of data using parallel processing #' -#' future::plan(multisession) +#' future::plan("multisession") #' global <- get_GSOD(years = 2010:2015, max_missing = 5) #' #' global @@ -194,16 +194,5 @@ get_GSOD <- function(years, GSOD_XY <- apply_process_gz(file_list, isd_history) return(GSOD_XY) - # Cleanup -------------------------------------------------------------------- - files <- - list.files( - cache_dir, - ignore.case = TRUE, - include.dirs = TRUE, - full.names = TRUE, - recursive = TRUE, - pattern = ".gz$" - ) - unlink(files, force = TRUE, recursive = TRUE) - rm(cache_dir) } + diff --git a/R/internal_functions.R b/R/internal_functions.R index 2192eb1a..9703016d 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -112,7 +112,7 @@ tryCatch( Map( function(ftp, dest) - utils::download.file( + curl::curl_download( url = ftp, destfile = dest, mode = "wb" @@ -190,7 +190,7 @@ return() } } - + pb <- dplyr::progress_estimated(length(years)) purrr::walk(years, function(yr) { year_url <- sprintf(ftp_base, yr) @@ -202,7 +202,7 @@ purrr::map(station, ~ grep(., fils, value = TRUE)) %>% purrr::keep( ~ length(.) > 0) %>% purrr::flatten_chr() -> fils - + if (length(fils) > 0) { # grab the station files purrr::walk(paste0(year_url, fils), retry_cfd) @@ -247,7 +247,7 @@ isd_history, cache_dir, years) { - + station_list <- isd_history[isd_history$CTRY == country, ]$STNID station_list <- do.call(paste0, diff --git a/R/reformat_GSOD.R b/R/reformat_GSOD.R index 9844099c..0a0a86f4 100644 --- a/R/reformat_GSOD.R +++ b/R/reformat_GSOD.R @@ -17,7 +17,7 @@ #' #' Parallel processing can be enabled using \code{\link[future]{plan}} to set #' up a parallel backend of your choice, e.g., -#' \code{future::plan(multisession)}. See examples for more. +#' \code{future::plan("multisession")}. See examples for more. #' #' @param dsn User supplied file path to location of data files on local disk #' for tidying. diff --git a/codemeta.json b/codemeta.json index ed74e320..9ece780b 100644 --- a/codemeta.json +++ b/codemeta.json @@ -35,7 +35,7 @@ "keywords": ["US-NCEI", "meteorological-data", "global-weather", "weather", "weather-data", "meteorology", "station-data", "surface-weather", "data-access", "US-NCDC", "r", "gsod", "ncdc", "weather-stations", "global-data", "ncei", "weather-information", "historical-weather", "historical-data", "daily-data", "daily-weather", "rstats", "r-package", "peer-reviewed"], "license": "https://spdx.org/licenses/MIT", "title": "GSODR", - "version": "1.3.0", + "version": "1.3.1", "name": "GSODR: Global Surface Summary of the Day ('GSOD') Weather Data Client", "issueTracker": "https://github.com/ropensci/GSODR/issues", "programmingLanguage": { @@ -447,7 +447,7 @@ "contIntegration": "https://travis-ci.org/ropensci/GSODR", "releaseNotes": "https://github.com/ropensci/GSODR/blob/master/NEWS.md", "readme": "https://github.com/ropensci/GSODR/blob/master/README.md", - "fileSize": "1237.803KB", + "fileSize": "1236.959KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/cran-comments.md b/cran-comments.md index 97a8762f..1914641e 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,9 +2,9 @@ - macOS, R version 3.5.1 (2018-07-02) - - Debian Linux, R version 3.5.1 (2018-07-02) + - Ubuntu Linux 18.04.1, R version 3.5.1 (2018-07-02) - - win-builder, R Under development (unstable) (2018-09-20 r75339) + - win-builder, R Under development (unstable) (2018-12-17 r75857) - win-builder, R version 3.5.1 (2018-04-23) @@ -13,10 +13,9 @@ 0 errors | 0 warnings | 1 note -# New Minor Release +# New Patch Release -- This release adds functionality to support using the `future` package for - parallel processing +- This release fixes examples that were incorrectly written and would not run # Reverse dependencies diff --git a/data-raw/fetch_country-list.Rmd b/data-raw/fetch_country-list.Rmd index b2f63229..6ee60256 100644 --- a/data-raw/fetch_country-list.Rmd +++ b/data-raw/fetch_country-list.Rmd @@ -21,7 +21,7 @@ codes are used when a user selects a single country for a data query. Read "country-list.txt" file from NCEI FTP server and merge with _countrycode_ data. -```{r download_merge_inspect, echo=TRUE, messages=FALSE} +```{r download-merge-inspect, echo=TRUE, messages=FALSE} if (!require("countrycode")) { install.packages("countrycode", @@ -32,7 +32,11 @@ if (!require("dplyr")) install.packages("dplyr", repos = c(CRAN = "https://cran.rstudio.com")) } +``` + +```{r read-table, echo=TRUE, messages=FALSE} +```{r download-and-merge, echo=TRUE, message=FALSE} countries <- readr::read_table( "ftp://ftp.ncdc.noaa.gov/pub/data/noaa/country-list.txt")[-1, c(1, 3)] names(countries)[2] <- "COUNTRY_NAME" @@ -46,10 +50,12 @@ print(country_list) There are unnecessary data in several columns. _GSODR_ only requires FIPS, name, and ISO codes to function. -```{r remove_uncessesary, echo=TRUE, messages=FALSE} - -country_list <- select(country_list, c("FIPS", "COUNTRY_NAME", "iso2c", "iso3c")) +```{r remove-uncessesary, echo=TRUE, messages=FALSE} +country_list <- dplyr::select(country_list, c("FIPS", + "COUNTRY_NAME", + "iso2c", + "iso3c")) country_list ``` @@ -65,9 +71,7 @@ save(country_list, file = "../inst/extdata/country_list.rda", Users of these data should take into account the following (from the [NCEI website](http://www7.ncdc.noaa.gov/CDO/cdoselect.cmd?datasetabbv=GSOD&countryabbv=&georegionabbv=)): - -> "The following data and products may have conditions placed on their -> international commercial use. They can be used within the U.S. or for +> "The following data and products may have conditions placed on their international commercial use. They can be used within the U.S. or for > non-commercial international activities without restriction. The non-U.S. > data cannot be redistributed for commercial purposes. Re-distribution of these > data by others must provide this same notification." diff --git a/data-raw/fetch_country-list.md b/data-raw/fetch_country-list.md index 1b0eb0c6..49bdde03 100644 --- a/data-raw/fetch_country-list.md +++ b/data-raw/fetch_country-list.md @@ -1,7 +1,7 @@ Fetch GSOD Country List and Merge with ISO Country Codes ================ Adam H. Sparks -2018-11-19 +2018-12-19 # Introduction @@ -51,16 +51,6 @@ if (!require("dplyr")) ``` r countries <- readr::read_table( "ftp://ftp.ncdc.noaa.gov/pub/data/noaa/country-list.txt")[-1, c(1, 3)] -``` - - ## Parsed with column specification: - ## cols( - ## FIPS = col_character(), - ## ID = col_character(), - ## `COUNTRY NAME` = col_character() - ## ) - -``` r names(countries)[2] <- "COUNTRY_NAME" country_list <- dplyr::left_join(countries, countrycode::codelist, @@ -69,20 +59,20 @@ country_list <- dplyr::left_join(countries, countrycode::codelist, print(country_list) ``` - ## # A tibble: 293 x 682 + ## # A tibble: 292 x 682 ## FIPS COUNTRY_NAME ar5 continent country.name.de country.name.de… ## - ## 1 AA ARUBA LAM Americas Aruba "^(?!.*bonaire)… - ## 2 AC ANTIGUA AND… LAM Americas Antigua und Ba… antigua - ## 3 AF AFGHANISTAN ASIA Asia Afghanistan afghan - ## 4 AG ALGERIA MAF Africa Algerien algerien - ## 5 AI ASCENSION I… - ## 6 AJ AZERBAIJAN EIT Asia Aserbaidschan aserbaidsch - ## 7 AL ALBANIA EIT Europe Albanien albanien - ## 8 AM ARMENIA EIT Asia Armenien armenien - ## 9 AN ANDORRA OECD… Europe Andorra andorra - ## 10 AO ANGOLA MAF Africa Angola angola - ## # ... with 283 more rows, and 676 more variables: country.name.en , + ## 1 AC ANTIGUA AND… LAM Americas Antigua und Ba… antigua + ## 2 AF AFGHANISTAN ASIA Asia Afghanistan afghan + ## 3 AG ALGERIA MAF Africa Algerien algerien + ## 4 AI ASCENSION I… + ## 5 AJ AZERBAIJAN EIT Asia Aserbaidschan aserbaidsch + ## 6 AL ALBANIA EIT Europe Albanien albanien + ## 7 AM ARMENIA EIT Asia Armenien armenien + ## 8 AN ANDORRA OECD… Europe Andorra andorra + ## 9 AO ANGOLA MAF Africa Angola angola + ## 10 AQ AMERICAN SA… ASIA Oceania Amerikanisch-S… ^(?=.*amerik).*… + ## # ... with 282 more rows, and 676 more variables: country.name.en , ## # country.name.en.regex , cow.name , cowc , cown , ## # ecb , ecb.name , eu28 , eurocontrol_pru , ## # eurocontrol_statfor , eurostat , eurostat.name , @@ -114,29 +104,30 @@ print(country_list) ## # cldr.name.en , … There are unnecessary data in several columns. *GSODR* only requires -FIPS, name, and ISO codes to -function. +FIPS, name, and ISO codes to function. ``` r -country_list <- select(country_list, c("FIPS", "COUNTRY_NAME", "iso2c", "iso3c")) - +country_list <- dplyr::select(country_list, c("FIPS", + "COUNTRY_NAME", + "iso2c", + "iso3c")) country_list ``` - ## # A tibble: 293 x 4 + ## # A tibble: 292 x 4 ## FIPS COUNTRY_NAME iso2c iso3c ## - ## 1 AA ARUBA AW ABW - ## 2 AC ANTIGUA AND BARBUDA AG ATG - ## 3 AF AFGHANISTAN AF AFG - ## 4 AG ALGERIA DZ DZA - ## 5 AI ASCENSION ISLAND - ## 6 AJ AZERBAIJAN AZ AZE - ## 7 AL ALBANIA AL ALB - ## 8 AM ARMENIA AM ARM - ## 9 AN ANDORRA AD AND - ## 10 AO ANGOLA AO AGO - ## # ... with 283 more rows + ## 1 AC ANTIGUA AND BARBUDA AG ATG + ## 2 AF AFGHANISTAN AF AFG + ## 3 AG ALGERIA DZ DZA + ## 4 AI ASCENSION ISLAND + ## 5 AJ AZERBAIJAN AZ AZE + ## 6 AL ALBANIA AL ALB + ## 7 AM ARMENIA AM ARM + ## 8 AN ANDORRA AD AND + ## 9 AO ANGOLA AO AGO + ## 10 AQ AMERICAN SAMOA AS ASM + ## # ... with 282 more rows Write .rda file to disk. @@ -152,66 +143,65 @@ save(country_list, file = "../inst/extdata/country_list.rda", Users of these data should take into account the following (from the [NCEI website](http://www7.ncdc.noaa.gov/CDO/cdoselect.cmd?datasetabbv=GSOD&countryabbv=&georegionabbv=)): - -> “The following data and products may have conditions placed on their -> international commercial use. They can be used within the U.S. or for -> non-commercial international activities without restriction. The -> non-U.S. data cannot be redistributed for commercial purposes. -> Re-distribution of these data by others must provide this same -> notification.” [WMO Resolution 40. NOAA -> Policy](http://www.wmo.int/pages/about/Resolution40.html) +\> “The following data and products may have conditions placed on their +international commercial use. They can be used within the U.S. or for \> +non-commercial international activities without restriction. The +non-U.S. \> data cannot be redistributed for commercial purposes. +Re-distribution of these \> data by others must provide this same +notification.” [WMO Resolution 40. NOAA +Policy](http://www.wmo.int/pages/about/Resolution40.html) ## R System Information ## ─ Session info ────────────────────────────────────────────────────────── ## setting value ## version R version 3.5.1 (2018-07-02) - ## os macOS 10.14.1 - ## system x86_64, darwin18.0.0 + ## os macOS 10.14.2 + ## system x86_64, darwin18.2.0 ## ui X11 ## language (EN) ## collate en_AU.UTF-8 ## ctype en_AU.UTF-8 ## tz Australia/Brisbane - ## date 2018-11-19 + ## date 2018-12-19 ## ## ─ Packages ────────────────────────────────────────────────────────────── - ## package * version date lib source - ## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1) - ## backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.1) - ## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.1) - ## bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.5.1) - ## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1) - ## colorout * 1.2-0 2018-10-17 [1] Github (jalvesaq/colorout@cc5fbfa) - ## countrycode * 1.1.0 2018-10-27 [1] CRAN (R 3.5.1) - ## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1) - ## curl 3.2 2018-03-28 [1] CRAN (R 3.5.1) - ## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1) - ## dplyr * 0.7.8 2018-11-10 [1] CRAN (R 3.5.1) - ## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.1) - ## fansi 0.4.0 2018-10-05 [1] CRAN (R 3.5.1) - ## glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.1) - ## hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1) - ## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1) - ## knitr 1.20 2018-02-20 [1] CRAN (R 3.5.1) - ## magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1) - ## pillar 1.3.0 2018-07-14 [1] CRAN (R 3.5.1) - ## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1) - ## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1) - ## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1) - ## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.1) - ## readr 1.1.1 2017-05-16 [1] CRAN (R 3.5.1) - ## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1) - ## rmarkdown 1.10 2018-06-11 [1] CRAN (R 3.5.1) - ## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1) - ## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.1) - ## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1) - ## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1) - ## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.5.1) - ## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1) - ## utf8 1.1.4 2018-05-24 [1] CRAN (R 3.5.1) - ## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1) - ## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1) + ## package * version date lib source + ## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1) + ## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.1) + ## bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.5.1) + ## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1) + ## colorout * 1.2-0 2018-11-06 [1] local + ## countrycode * 1.1.0 2018-10-27 [1] CRAN (R 3.5.1) + ## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1) + ## curl 3.2 2018-03-28 [1] CRAN (R 3.5.1) + ## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1) + ## dplyr * 0.7.8 2018-11-10 [1] CRAN (R 3.5.1) + ## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.1) + ## fansi 0.4.0 2018-10-05 [1] CRAN (R 3.5.1) + ## glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.1) + ## hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1) + ## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1) + ## knitr 1.21 2018-12-10 [1] CRAN (R 3.5.1) + ## magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1) + ## pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.1) + ## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1) + ## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1) + ## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1) + ## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.1) + ## readr 1.3.0 2018-12-11 [1] CRAN (R 3.5.1) + ## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1) + ## rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.5.1) + ## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.1) + ## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1) + ## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1) + ## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.5.1) + ## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1) + ## utf8 1.1.4 2018-05-24 [1] CRAN (R 3.5.1) + ## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1) + ## xfun 0.4 2018-10-23 [1] CRAN (R 3.5.1) + ## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1) ## - ## [1] /Users/asparks/Library/R/3.x/library - ## [2] /usr/local/Cellar/r/3.5.1/lib/R/library + ## [1] /Users/U8004755/Library/R/3.x/library + ## [2] /usr/local/lib/R/3.5/site-library + ## [3] /usr/local/Cellar/r/3.5.1/lib/R/library diff --git a/data-raw/fetch_isd-history.Rmd b/data-raw/fetch_isd-history.Rmd index d785302a..883628b3 100644 --- a/data-raw/fetch_isd-history.Rmd +++ b/data-raw/fetch_isd-history.Rmd @@ -345,9 +345,3 @@ Journal of Climatology*. 25: 1965-1978. Jarvis, A, HI Reuter, A Nelson, E Guevara, 2008, Hole-filled SRTM for the globe Version 4, available from the CGIAR-CSI SRTM 90m Database ([http://srtm.csi.cgiar.org](http://srtm.csi.cgiar.org)) - -Jarvis, A, J Rubiano, A Nelson, A Farrow and M Mulligan, 2004, Practical use of -SRTM Data in the Tropics: Comparisons with Digital Elevation Models Generated -From Cartographic Data. Working Document no. 198. Cali, CO. -International Centre for Tropical Agriculture (CIAT): 32. -[URL](http://srtm.csi.cgiar.org/PDF/Jarvis4.pdf) diff --git a/data-raw/fetch_isd-history.md b/data-raw/fetch_isd-history.md index da3621c7..43657fda 100644 --- a/data-raw/fetch_isd-history.md +++ b/data-raw/fetch_isd-history.md @@ -1,7 +1,7 @@ Fetch, Clean and Correct Altitude in GSOD ‘isd\_history.csv’ Data ================ Adam H. Sparks -2018-11-19 +2018-12-19 # Introduction @@ -101,17 +101,7 @@ tf <- tempfile() ``` r # import Natural Earth cultural 1:10m data NE <- ne_countries(scale = 10) -``` - - ## Install the rnaturalearthhires package? - ## - ## 1: Yes - ## 2: No - ## - ## Enter an item from the menu, or 0 to exit - ## Enter an item from the menu, or 0 to exit -``` r # download data stations <- read_csv( "ftp://ftp.ncdc.noaa.gov/pub/data/noaa/isd-history.csv", @@ -291,7 +281,7 @@ isd_history <- str(isd_history) ``` - ## Classes 'tbl_df', 'tbl' and 'data.frame': 28099 obs. of 13 variables: + ## Classes 'tbl_df', 'tbl' and 'data.frame': 28100 obs. of 13 variables: ## $ USAF : chr "008268" "010010" "010014" "010015" ... ## $ WBAN : chr "99999" "99999" "99999" "99999" ... ## $ STN_NAME : chr "WXPOD8278" "JAN MAYEN(NOR-NAVY)" "SORSTOKKEN" "BRINGELAND" ... @@ -302,7 +292,7 @@ str(isd_history) ## $ LON : num 65.57 -8.67 5.34 5.87 11.23 ... ## $ ELEV_M : num 1156.7 9 48.8 327 14 ... ## $ BEGIN : int 20100519 19310101 19861120 19870117 19870116 19880320 19861109 19850601 19730101 19310103 ... - ## $ END : int 20120323 20181113 20181113 20081231 19910806 20050228 20181113 20181113 20140523 20041030 ... + ## $ END : int 20120323 20181216 20181216 20081231 19910806 20050228 20181216 20181216 20140523 20041030 ... ## $ STNID : chr "008268-99999" "010010-99999" "010014-99999" "010015-99999" ... ## $ ELEV_M_SRTM_90m: num 1160 NA 48 NA NA 48 NA NA NA NA ... @@ -310,7 +300,7 @@ str(isd_history) isd_history ``` - ## # A tibble: 28,099 x 13 + ## # A tibble: 28,100 x 13 ## USAF WBAN STN_NAME CTRY STATE CALL LAT LON ELEV_M BEGIN END ## ## 1 0082… 99999 WXPOD82… AF 33.0 65.6 1157. 2.01e7 2.01e7 @@ -323,7 +313,7 @@ isd_history ## 8 0100… 99999 HORNSUND NO 77 15.5 12 1.99e7 2.02e7 ## 9 0100… 99999 NY-ALES… NO ENAS 78.9 11.9 8 1.97e7 2.01e7 ## 10 0100… 99999 ISFJORD… SV 78.1 13.6 9 1.93e7 2.00e7 - ## # ... with 28,089 more rows, and 2 more variables: STNID , + ## # ... with 28,090 more rows, and 2 more variables: STNID , ## # ELEV_M_SRTM_90m # Figures @@ -387,121 +377,84 @@ website](http://www7.ncdc.noaa.gov/CDO/cdoselect.cmd?datasetabbv=GSOD&countryabb ## ─ Session info ────────────────────────────────────────────────────────── ## setting value ## version R version 3.5.1 (2018-07-02) - ## os macOS 10.14.1 - ## system x86_64, darwin18.0.0 + ## os macOS 10.14.2 + ## system x86_64, darwin18.2.0 ## ui X11 ## language (EN) - ## collate en_US.UTF-8 - ## ctype en_US.UTF-8 + ## collate en_AU.UTF-8 + ## ctype en_AU.UTF-8 ## tz Australia/Brisbane - ## date 2018-11-19 + ## date 2018-12-19 ## ## ─ Packages ────────────────────────────────────────────────────────────── - ## ! package * version date lib source - ## R .py 0.1.3 [?] - ## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1) - ## backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.1) - ## base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.5.1) - ## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.1) - ## bindrcpp * 0.2.2 2018-03-29 [1] CRAN (R 3.5.1) - ## callr 3.0.0 2018-08-24 [1] CRAN (R 3.5.1) - ## class 7.3-14 2015-08-30 [3] CRAN (R 3.5.1) - ## classInt 0.2-3 2018-04-16 [1] CRAN (R 3.5.1) - ## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1) - ## codetools 0.2-15 2016-10-05 [3] CRAN (R 3.5.1) - ## colorout * 1.2-0 2018-11-06 [1] local - ## colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.5.1) - ## commonmark 1.6 2018-09-30 [1] CRAN (R 3.5.1) - ## countrycode 1.1.0 2018-10-27 [1] CRAN (R 3.5.1) - ## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1) - ## curl 3.2 2018-03-28 [1] CRAN (R 3.5.1) - ## DBI 1.0.0 2018-05-02 [1] CRAN (R 3.5.1) - ## desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.1) - ## devtools 2.0.1 2018-10-26 [1] CRAN (R 3.5.1) - ## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1) - ## doParallel * 1.0.14 2018-09-24 [1] CRAN (R 3.5.1) - ## dplyr * 0.7.8 2018-11-10 [1] CRAN (R 3.5.1) - ## e1071 1.7-0 2018-07-28 [1] CRAN (R 3.5.1) - ## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.1) - ## extrafont 0.17 2014-12-08 [1] CRAN (R 3.5.1) - ## extrafontdb 1.0 2012-06-11 [1] CRAN (R 3.5.1) - ## fansi 0.4.0 2018-10-05 [1] CRAN (R 3.5.1) - ## foreach * 1.4.4 2017-12-12 [1] CRAN (R 3.5.1) - ## fs 1.2.6 2018-08-23 [1] CRAN (R 3.5.1) - ## future 1.10.0 2018-10-17 [1] CRAN (R 3.5.1) - ## future.apply 1.0.1 2018-08-26 [1] CRAN (R 3.5.1) - ## ggplot2 * 3.1.0 2018-10-25 [1] CRAN (R 3.5.1) - ## globals 0.12.4 2018-10-11 [1] CRAN (R 3.5.1) - ## glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.1) - ## GSODR * 1.2.3.9000 2018-11-19 [1] CRAN (R 3.5.1) - ## gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.1) - ## highr 0.7 2018-06-09 [1] CRAN (R 3.5.1) - ## hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1) - ## hrbrthemes * 0.5.0.1 2018-08-19 [1] CRAN (R 3.5.1) - ## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1) - ## httr 1.3.1 2017-08-20 [1] CRAN (R 3.5.1) - ## iterators * 1.0.10 2018-07-13 [1] CRAN (R 3.5.1) - ## jsonlite 1.5 2017-06-01 [1] CRAN (R 3.5.1) - ## knitr 1.20 2018-02-20 [1] CRAN (R 3.5.1) - ## labeling 0.3 2014-08-23 [1] CRAN (R 3.5.1) - ## lattice 0.20-38 2018-11-04 [3] CRAN (R 3.5.1) - ## lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.1) - ## listenv 0.7.0 2018-01-21 [1] CRAN (R 3.5.1) - ## magick 2.0 2018-10-05 [1] CRAN (R 3.5.1) - ## magrittr * 1.5 2014-11-22 [1] CRAN (R 3.5.1) - ## MASS 7.3-51.1 2018-11-01 [3] CRAN (R 3.5.1) - ## memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.1) - ## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.1) - ## pillar 1.3.0 2018-07-14 [1] CRAN (R 3.5.1) - ## pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.5.1) - ## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1) - ## pkgdown * 1.1.0 2018-06-02 [1] CRAN (R 3.5.1) - ## pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.1) - ## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.1) - ## prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.1) - ## processx 3.2.0 2018-08-16 [1] CRAN (R 3.5.1) - ## ps 1.2.1 2018-11-06 [1] CRAN (R 3.5.1) - ## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1) - ## R.methodsS3 1.7.1 2016-02-16 [1] CRAN (R 3.5.1) - ## R.oo 1.22.0 2018-04-22 [1] CRAN (R 3.5.1) - ## R.utils 2.7.0 2018-08-27 [1] CRAN (R 3.5.1) - ## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1) - ## raster * 2.8-4 2018-11-03 [1] CRAN (R 3.5.1) - ## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.1) - ## readr * 1.1.1 2017-05-16 [1] CRAN (R 3.5.1) - ## remotes 2.0.2 2018-10-30 [1] CRAN (R 3.5.1) - ## rgdal 1.3-6 2018-10-16 [1] CRAN (R 3.5.1) - ## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1) - ## rmarkdown 1.10 2018-06-11 [1] CRAN (R 3.5.1) - ## rnaturalearth * 0.1.0 2017-03-21 [1] CRAN (R 3.5.1) - ## rnaturalearthhires 0.2.0 2018-11-19 [1] local - ## roxygen2 6.1.1 2018-11-07 [1] CRAN (R 3.5.1) - ## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1) - ## rstudioapi 0.8 2018-10-02 [1] CRAN (R 3.5.1) - ## Rttf2pt1 1.3.7 2018-06-29 [1] CRAN (R 3.5.1) - ## scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1) - ## sessioninfo * 1.1.1 2018-11-05 [1] CRAN (R 3.5.1) - ## sf 0.7-1 2018-10-24 [1] CRAN (R 3.5.1) - ## sp * 1.3-1 2018-06-05 [1] CRAN (R 3.5.1) - ## spData 0.2.9.4 2018-09-15 [1] CRAN (R 3.5.1) - ## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1) - ## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1) - ## testthat 2.0.1 2018-10-13 [1] CRAN (R 3.5.1) - ## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.5.1) - ## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1) - ## units 0.6-1 2018-09-21 [1] CRAN (R 3.5.1) - ## usethis 1.4.0 2018-08-14 [1] CRAN (R 3.5.1) - ## utf8 1.1.4 2018-05-24 [1] CRAN (R 3.5.1) - ## whisker 0.3-2 2013-04-28 [1] CRAN (R 3.5.1) - ## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1) - ## xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.1) - ## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1) + ## package * version date lib source + ## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1) + ## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.1) + ## bindrcpp * 0.2.2 2018-03-29 [1] CRAN (R 3.5.1) + ## class 7.3-14 2015-08-30 [3] CRAN (R 3.5.1) + ## classInt 0.2-3 2018-04-16 [1] CRAN (R 3.5.1) + ## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1) + ## codetools 0.2-15 2016-10-05 [3] CRAN (R 3.5.1) + ## colorout * 1.2-0 2018-11-06 [1] local + ## colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.5.1) + ## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1) + ## curl 3.2 2018-03-28 [1] CRAN (R 3.5.1) + ## DBI 1.0.0 2018-05-02 [1] CRAN (R 3.5.1) + ## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1) + ## doParallel * 1.0.14 2018-09-24 [1] CRAN (R 3.5.1) + ## dplyr * 0.7.8 2018-11-10 [1] CRAN (R 3.5.1) + ## e1071 1.7-0 2018-07-28 [1] CRAN (R 3.5.1) + ## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.1) + ## extrafont 0.17 2014-12-08 [1] CRAN (R 3.5.1) + ## extrafontdb 1.0 2012-06-11 [1] CRAN (R 3.5.1) + ## fansi 0.4.0 2018-10-05 [1] CRAN (R 3.5.1) + ## foreach * 1.4.4 2017-12-12 [1] CRAN (R 3.5.1) + ## ggplot2 * 3.1.0 2018-10-25 [1] CRAN (R 3.5.1) + ## glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.1) + ## gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.1) + ## highr 0.7 2018-06-09 [1] CRAN (R 3.5.1) + ## hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1) + ## hrbrthemes * 0.5.0.1 2018-08-19 [1] CRAN (R 3.5.1) + ## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1) + ## iterators * 1.0.10 2018-07-13 [1] CRAN (R 3.5.1) + ## knitr 1.21 2018-12-10 [1] CRAN (R 3.5.1) + ## labeling 0.3 2014-08-23 [1] CRAN (R 3.5.1) + ## lattice 0.20-35 2017-03-25 [3] CRAN (R 3.5.1) + ## lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.1) + ## magrittr * 1.5 2014-11-22 [1] CRAN (R 3.5.1) + ## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.1) + ## pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.1) + ## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1) + ## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.1) + ## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1) + ## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1) + ## raster * 2.8-4 2018-11-03 [1] CRAN (R 3.5.1) + ## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.1) + ## readr * 1.3.0 2018-12-11 [1] CRAN (R 3.5.1) + ## rgdal 1.3-6 2018-10-16 [1] CRAN (R 3.5.1) + ## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1) + ## rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.5.1) + ## rnaturalearth * 0.1.0 2017-03-21 [1] CRAN (R 3.5.1) + ## rnaturalearthhires 0.2.0 2018-11-19 [1] local + ## Rttf2pt1 1.3.7 2018-06-29 [1] CRAN (R 3.5.1) + ## scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1) + ## sessioninfo * 1.1.1 2018-11-05 [1] CRAN (R 3.5.1) + ## sf 0.7-1 2018-10-24 [1] CRAN (R 3.5.1) + ## sp * 1.3-1 2018-06-05 [1] CRAN (R 3.5.1) + ## spData 0.2.9.6 2018-12-03 [1] CRAN (R 3.5.1) + ## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1) + ## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1) + ## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.5.1) + ## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1) + ## units 0.6-2 2018-12-05 [1] CRAN (R 3.5.1) + ## utf8 1.1.4 2018-05-24 [1] CRAN (R 3.5.1) + ## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1) + ## xfun 0.4 2018-10-23 [1] CRAN (R 3.5.1) + ## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1) ## ## [1] /Users/U8004755/Library/R/3.x/library ## [2] /usr/local/lib/R/3.5/site-library ## [3] /usr/local/Cellar/r/3.5.1/lib/R/library - ## - ## R ── Package was removed from disk. # References @@ -513,9 +466,3 @@ Resolution Interpolated Climate Surfaces for Global Land Areas. Jarvis, A, HI Reuter, A Nelson, E Guevara, 2008, Hole-filled SRTM for the globe Version 4, available from the CGIAR-CSI SRTM 90m Database () - -Jarvis, A, J Rubiano, A Nelson, A Farrow and M Mulligan, 2004, Practical -use of SRTM Data in the Tropics: Comparisons with Digital Elevation -Models Generated From Cartographic Data. Working Document no. 198. Cali, -CO. International Centre for Tropical Agriculture (CIAT): 32. -[URL](http://srtm.csi.cgiar.org/PDF/Jarvis4.pdf) diff --git a/docs/CONDUCT.html b/docs/CONDUCT.html index 9601ee6c..a078cb8d 100644 --- a/docs/CONDUCT.html +++ b/docs/CONDUCT.html @@ -1,6 +1,6 @@ - + @@ -9,17 +9,17 @@ Contributor Code of Conduct • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ CONTRIBUTING • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ License • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + + GSODR • GSODR - - - + + + - @@ -23,14 +23,15 @@
@@ -257,94 +258,94 @@

Convert to an sp SpatialPointsDataFrame

For this example we convert the data to a sp object. You might use this one to save GeoPackage or ESRI shapefiles for sharing or analysis in another GIS program.

-
# get GSOD data
-library(sp)
-GSOD <- get_GSOD(years = 2015, country = "Australia")
-
-# convert to SpatialPointsDataFrame
-coordinates(GSOD_sp) <- ~ LON + LAT
-proj4string(GSOD_sp) <- CRS("+proj=longlat +datum=WGS84")
-
-str(GSOD_sp)
-
#> Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
-#>   ..@ data       :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':  186977 obs. of  46 variables:
-#>   .. ..$ USAF            : chr [1:186977] "941000" "941000" "941000" "941000" ...
-#>   .. ..$ WBAN            : chr [1:186977] "99999" "99999" "99999" "99999" ...
-#>   .. ..$ STNID           : chr [1:186977] "941000-99999" "941000-99999" "941000-99999" "941000-99999" ...
-#>   .. ..$ STN_NAME        : chr [1:186977] "KALUMBURU" "KALUMBURU" "KALUMBURU" "KALUMBURU" ...
-#>   .. ..$ CTRY            : chr [1:186977] "AS" "AS" "AS" "AS" ...
-#>   .. ..$ STATE           : chr [1:186977] NA NA NA NA ...
-#>   .. ..$ CALL            : chr [1:186977] NA NA NA NA ...
-#>   .. ..$ ELEV_M          : num [1:186977] 24 24 24 24 24 24 24 24 24 24 ...
-#>   .. ..$ ELEV_M_SRTM_90m : num [1:186977] 17 17 17 17 17 17 17 17 17 17 ...
-#>   .. ..$ BEGIN           : num [1:186977] 2e+07 2e+07 2e+07 2e+07 2e+07 ...
-#>   .. ..$ END             : num [1:186977] 20171212 20171212 20171212 20171212 20171212 ...
-#>   .. ..$ YEARMODA        : Date[1:186977], format: "2015-01-01" "2015-01-02" "2015-01-03" ...
-#>   .. ..$ YEAR            : chr [1:186977] "2015" "2015" "2015" "2015" ...
-#>   .. ..$ MONTH           : chr [1:186977] "01" "01" "01" "01" ...
-#>   .. ..$ DAY             : chr [1:186977] "01" "02" "03" "04" ...
-#>   .. ..$ YDAY            : num [1:186977] 1 2 3 4 5 6 7 8 9 10 ...
-#>   .. ..$ TEMP            : num [1:186977] 26.9 27.2 26.3 27.3 27.3 26.7 28.1 28.7 27.6 27.8 ...
-#>   .. ..$ TEMP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
-#>   .. ..$ DEWP            : num [1:186977] 23.2 23.3 23.8 24.1 24.3 24 23.6 23.3 21.9 22.3 ...
-#>   .. ..$ DEWP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
-#>   .. ..$ SLP             : num [1:186977] 1004 1003 1003 1002 1001 ...
-#>   .. ..$ SLP_CNT         : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
-#>   .. ..$ STP             : num [1:186977] 1002 1000 NA 999 998 ...
-#>   .. ..$ STP_CNT         : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
-#>   .. ..$ VISIB           : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
-#>   .. ..$ VISIB_CNT       : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ WDSP            : num [1:186977] 1.7 2.2 1.7 2 2.6 3.4 4.5 5.9 4.4 2.4 ...
-#>   .. ..$ WDSP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
-#>   .. ..$ MXSPD           : num [1:186977] 4.1 4.1 4.1 4.1 5.7 5.7 6.7 9.3 7.7 4.6 ...
-#>   .. ..$ GUST            : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
-#>   .. ..$ MAX             : num [1:186977] 31.5 31.3 29.2 32.1 31.4 28.6 30.2 31 32.7 32.9 ...
-#>   .. ..$ MAX_FLAG        : chr [1:186977] NA NA NA NA ...
-#>   .. ..$ MIN             : num [1:186977] 25 24.9 24.4 24.3 24.6 25.1 24.5 26.3 22.8 22.6 ...
-#>   .. ..$ MIN_FLAG        : chr [1:186977] NA "*" "*" NA ...
-#>   .. ..$ PRCP            : num [1:186977] 16.5 12.4 5.1 20.3 41.1 20.1 82.3 2.3 6.1 27.4 ...
-#>   .. ..$ PRCP_FLAG       : chr [1:186977] "G" "G" "G" "G" ...
-#>   .. ..$ SNDP            : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
-#>   .. ..$ I_FOG           : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ I_RAIN_DRIZZLE  : int [1:186977] 1 1 1 1 1 1 1 1 1 0 ...
-#>   .. ..$ I_SNOW_ICE      : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ I_HAIL          : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ I_THUNDER       : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ I_TORNADO_FUNNEL: int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
-#>   .. ..$ EA              : num [1:186977] 2.8 2.9 2.9 3 3 3 2.9 2.9 2.6 2.7 ...
-#>   .. ..$ ES              : num [1:186977] 3.5 3.6 3.4 3.6 3.6 3.5 3.8 3.9 3.7 3.7 ...
-#>   .. ..$ RH              : num [1:186977] 80 80.6 85.3 83.3 83.3 85.7 76.3 74.4 70.3 73 ...
-#>   ..@ coords.nrs : int [1:2] 9 8
-#>   ..@ coords     : num [1:186977, 1:2] 127 127 127 127 127 ...
-#>   .. ..- attr(*, "dimnames")=List of 2
-#>   .. .. ..$ : chr [1:186977] "1" "2" "3" "4" ...
-#>   .. .. ..$ : chr [1:2] "LON" "LAT"
-#>   ..@ bbox       : num [1:2, 1:2] 73.7 -54.5 159.1 -10.1
-#>   .. ..- attr(*, "dimnames")=List of 2
-#>   .. .. ..$ : chr [1:2] "LON" "LAT"
-#>   .. .. ..$ : chr [1:2] "min" "max"
-#>   ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
-#>   .. .. ..@ projargs: chr "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
+
# get GSOD data
+library(sp)
+GSOD <- get_GSOD(years = 2015, country = "Australia")
+
+# convert to SpatialPointsDataFrame
+coordinates(GSOD_sp) <- ~ LON + LAT
+proj4string(GSOD_sp) <- CRS("+proj=longlat +datum=WGS84")
+
+str(GSOD_sp)
+
#> Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
+#>   ..@ data       :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':  186977 obs. of  46 variables:
+#>   .. ..$ USAF            : chr [1:186977] "941000" "941000" "941000" "941000" ...
+#>   .. ..$ WBAN            : chr [1:186977] "99999" "99999" "99999" "99999" ...
+#>   .. ..$ STNID           : chr [1:186977] "941000-99999" "941000-99999" "941000-99999" "941000-99999" ...
+#>   .. ..$ STN_NAME        : chr [1:186977] "KALUMBURU" "KALUMBURU" "KALUMBURU" "KALUMBURU" ...
+#>   .. ..$ CTRY            : chr [1:186977] "AS" "AS" "AS" "AS" ...
+#>   .. ..$ STATE           : chr [1:186977] NA NA NA NA ...
+#>   .. ..$ CALL            : chr [1:186977] NA NA NA NA ...
+#>   .. ..$ ELEV_M          : num [1:186977] 24 24 24 24 24 24 24 24 24 24 ...
+#>   .. ..$ ELEV_M_SRTM_90m : num [1:186977] 17 17 17 17 17 17 17 17 17 17 ...
+#>   .. ..$ BEGIN           : num [1:186977] 2e+07 2e+07 2e+07 2e+07 2e+07 ...
+#>   .. ..$ END             : num [1:186977] 20171212 20171212 20171212 20171212 20171212 ...
+#>   .. ..$ YEARMODA        : Date[1:186977], format: "2015-01-01" "2015-01-02" "2015-01-03" ...
+#>   .. ..$ YEAR            : chr [1:186977] "2015" "2015" "2015" "2015" ...
+#>   .. ..$ MONTH           : chr [1:186977] "01" "01" "01" "01" ...
+#>   .. ..$ DAY             : chr [1:186977] "01" "02" "03" "04" ...
+#>   .. ..$ YDAY            : num [1:186977] 1 2 3 4 5 6 7 8 9 10 ...
+#>   .. ..$ TEMP            : num [1:186977] 26.9 27.2 26.3 27.3 27.3 26.7 28.1 28.7 27.6 27.8 ...
+#>   .. ..$ TEMP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
+#>   .. ..$ DEWP            : num [1:186977] 23.2 23.3 23.8 24.1 24.3 24 23.6 23.3 21.9 22.3 ...
+#>   .. ..$ DEWP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
+#>   .. ..$ SLP             : num [1:186977] 1004 1003 1003 1002 1001 ...
+#>   .. ..$ SLP_CNT         : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
+#>   .. ..$ STP             : num [1:186977] 1002 1000 NA 999 998 ...
+#>   .. ..$ STP_CNT         : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
+#>   .. ..$ VISIB           : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
+#>   .. ..$ VISIB_CNT       : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ WDSP            : num [1:186977] 1.7 2.2 1.7 2 2.6 3.4 4.5 5.9 4.4 2.4 ...
+#>   .. ..$ WDSP_CNT        : int [1:186977] 16 16 16 16 16 16 16 16 16 16 ...
+#>   .. ..$ MXSPD           : num [1:186977] 4.1 4.1 4.1 4.1 5.7 5.7 6.7 9.3 7.7 4.6 ...
+#>   .. ..$ GUST            : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
+#>   .. ..$ MAX             : num [1:186977] 31.5 31.3 29.2 32.1 31.4 28.6 30.2 31 32.7 32.9 ...
+#>   .. ..$ MAX_FLAG        : chr [1:186977] NA NA NA NA ...
+#>   .. ..$ MIN             : num [1:186977] 25 24.9 24.4 24.3 24.6 25.1 24.5 26.3 22.8 22.6 ...
+#>   .. ..$ MIN_FLAG        : chr [1:186977] NA "*" "*" NA ...
+#>   .. ..$ PRCP            : num [1:186977] 16.5 12.4 5.1 20.3 41.1 20.1 82.3 2.3 6.1 27.4 ...
+#>   .. ..$ PRCP_FLAG       : chr [1:186977] "G" "G" "G" "G" ...
+#>   .. ..$ SNDP            : num [1:186977] NA NA NA NA NA NA NA NA NA NA ...
+#>   .. ..$ I_FOG           : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ I_RAIN_DRIZZLE  : int [1:186977] 1 1 1 1 1 1 1 1 1 0 ...
+#>   .. ..$ I_SNOW_ICE      : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ I_HAIL          : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ I_THUNDER       : int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ I_TORNADO_FUNNEL: int [1:186977] 0 0 0 0 0 0 0 0 0 0 ...
+#>   .. ..$ EA              : num [1:186977] 2.8 2.9 2.9 3 3 3 2.9 2.9 2.6 2.7 ...
+#>   .. ..$ ES              : num [1:186977] 3.5 3.6 3.4 3.6 3.6 3.5 3.8 3.9 3.7 3.7 ...
+#>   .. ..$ RH              : num [1:186977] 80 80.6 85.3 83.3 83.3 85.7 76.3 74.4 70.3 73 ...
+#>   ..@ coords.nrs : int [1:2] 9 8
+#>   ..@ coords     : num [1:186977, 1:2] 127 127 127 127 127 ...
+#>   .. ..- attr(*, "dimnames")=List of 2
+#>   .. .. ..$ : chr [1:186977] "1" "2" "3" "4" ...
+#>   .. .. ..$ : chr [1:2] "LON" "LAT"
+#>   ..@ bbox       : num [1:2, 1:2] 73.7 -54.5 159.1 -10.1
+#>   .. ..- attr(*, "dimnames")=List of 2
+#>   .. .. ..$ : chr [1:2] "LON" "LAT"
+#>   .. .. ..$ : chr [1:2] "min" "max"
+#>   ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
+#>   .. .. ..@ projargs: chr "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"

Saving sp objects

-

Using writeOGR() it is simple to save as a GeoPackage file.

- -

Using writeOGR() it is simple to save as an ESRI shapefile.

- +

Using writeOGR() it is simple to save as a GeoPackage file.

+
library(rgdal)
+
+  writeOGR(
+    GSOD_sp,
+    dsn = path.expand("~/"),
+    layer = "GSOD",
+    driver = "GPKG"
+  )
+

Using writeOGR() it is simple to save as an ESRI shapefile.

+
  writeOGR(
+    GSOD_sp,
+    dsn = path.expand("~/"),
+    layer = "GSOD",
+    driver = "ESRI Shapefile"
+  )

@@ -354,97 +355,97 @@

Simple features or simple feature access refers to a formal standard (ISO 19125-1:2004) that describes how objects in the real world can be represented in computers, with emphasis on the spatial geometry of these objects. It also describes how such objects can be stored in and retrieved from databases, and which geometrical operations should be defined for them. The standard is widely implemented in spatial databases (such as PostGIS), commercial GIS (e.g., ESRI ArcGIS) and forms the vector data basis for libraries such as GDAL. A subset of simple features forms the GeoJSON standard.

For this example, we convert the GSOD data to an sf object.

- -
#> Classes ‘sf’ and 'data.frame':   186977 obs. of  47 variables:
-#>  $ USAF            : chr  "941000" "941000" "941000" "941000" ...
-#>  $ WBAN            : chr  "99999" "99999" "99999" "99999" ...
-#>  $ STNID           : chr  "941000-99999" "941000-99999" "941000-99999" "941000-99999" ...
-#>  $ STN_NAME        : chr  "KALUMBURU" "KALUMBURU" "KALUMBURU" "KALUMBURU" ...
-#>  $ CTRY            : chr  "AS" "AS" "AS" "AS" ...
-#>  $ STATE           : chr  NA NA NA NA ...
-#>  $ CALL            : chr  NA NA NA NA ...
-#>  $ ELEV_M          : num  24 24 24 24 24 24 24 24 24 24 ...
-#>  $ ELEV_M_SRTM_90m : num  17 17 17 17 17 17 17 17 17 17 ...
-#>  $ BEGIN           : num  2e+07 2e+07 2e+07 2e+07 2e+07 ...
-#>  $ END             : num  20171212 20171212 20171212 20171212 20171212 ...
-#>  $ YEARMODA        : Date, format: "2015-01-01" "2015-01-02" ...
-#>  $ YEAR            : chr  "2015" "2015" "2015" "2015" ...
-#>  $ MONTH           : chr  "01" "01" "01" "01" ...
-#>  $ DAY             : chr  "01" "02" "03" "04" ...
-#>  $ YDAY            : num  1 2 3 4 5 6 7 8 9 10 ...
-#>  $ TEMP            : num  26.9 27.2 26.3 27.3 27.3 26.7 28.1 28.7 27.6 27.8 ...
-#>  $ TEMP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
-#>  $ DEWP            : num  23.2 23.3 23.8 24.1 24.3 24 23.6 23.3 21.9 22.3 ...
-#>  $ DEWP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
-#>  $ SLP             : num  1004 1003 1003 1002 1001 ...
-#>  $ SLP_CNT         : int  16 16 16 16 16 16 16 16 16 16 ...
-#>  $ STP             : num  1002 1000 NA 999 998 ...
-#>  $ STP_CNT         : int  16 16 16 16 16 16 16 16 16 16 ...
-#>  $ VISIB           : num  NA NA NA NA NA NA NA NA NA NA ...
-#>  $ VISIB_CNT       : int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ WDSP            : num  1.7 2.2 1.7 2 2.6 3.4 4.5 5.9 4.4 2.4 ...
-#>  $ WDSP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
-#>  $ MXSPD           : num  4.1 4.1 4.1 4.1 5.7 5.7 6.7 9.3 7.7 4.6 ...
-#>  $ GUST            : num  NA NA NA NA NA NA NA NA NA NA ...
-#>  $ MAX             : num  31.5 31.3 29.2 32.1 31.4 28.6 30.2 31 32.7 32.9 ...
-#>  $ MAX_FLAG        : chr  NA NA NA NA ...
-#>  $ MIN             : num  25 24.9 24.4 24.3 24.6 25.1 24.5 26.3 22.8 22.6 ...
-#>  $ MIN_FLAG        : chr  NA "*" "*" NA ...
-#>  $ PRCP            : num  16.5 12.4 5.1 20.3 41.1 20.1 82.3 2.3 6.1 27.4 ...
-#>  $ PRCP_FLAG       : chr  "G" "G" "G" "G" ...
-#>  $ SNDP            : num  NA NA NA NA NA NA NA NA NA NA ...
-#>  $ I_FOG           : int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ I_RAIN_DRIZZLE  : int  1 1 1 1 1 1 1 1 1 0 ...
-#>  $ I_SNOW_ICE      : int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ I_HAIL          : int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ I_THUNDER       : int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ I_TORNADO_FUNNEL: int  0 0 0 0 0 0 0 0 0 0 ...
-#>  $ EA              : num  2.8 2.9 2.9 3 3 3 2.9 2.9 2.6 2.7 ...
-#>  $ ES              : num  3.5 3.6 3.4 3.6 3.6 3.5 3.8 3.9 3.7 3.7 ...
-#>  $ RH              : num  80 80.6 85.3 83.3 83.3 85.7 76.3 74.4 70.3 73 ...
-#>  $ geometry        :sfc_POINT of length 186977; first list element: Classes 'XY', 'POINT', 'sfg'  num [1:2] 126.6 -14.3
-#>  - attr(*, "sf_column")= chr "geometry"
-#>  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA NA ...
-#>   ..- attr(*, "names")= chr  "USAF" "WBAN" "STNID" "STN_NAME" ...
+
library(sf)
+GSOD_SF <- st_as_sf(x = GSOD, 
+                        coords = c("LON", "LAT"),
+                        crs = "+proj=longlat +datum=WGS84")
+
+str(GSOD_SF)
+
#> Classes ‘sf’ and 'data.frame':   186977 obs. of  47 variables:
+#>  $ USAF            : chr  "941000" "941000" "941000" "941000" ...
+#>  $ WBAN            : chr  "99999" "99999" "99999" "99999" ...
+#>  $ STNID           : chr  "941000-99999" "941000-99999" "941000-99999" "941000-99999" ...
+#>  $ STN_NAME        : chr  "KALUMBURU" "KALUMBURU" "KALUMBURU" "KALUMBURU" ...
+#>  $ CTRY            : chr  "AS" "AS" "AS" "AS" ...
+#>  $ STATE           : chr  NA NA NA NA ...
+#>  $ CALL            : chr  NA NA NA NA ...
+#>  $ ELEV_M          : num  24 24 24 24 24 24 24 24 24 24 ...
+#>  $ ELEV_M_SRTM_90m : num  17 17 17 17 17 17 17 17 17 17 ...
+#>  $ BEGIN           : num  2e+07 2e+07 2e+07 2e+07 2e+07 ...
+#>  $ END             : num  20171212 20171212 20171212 20171212 20171212 ...
+#>  $ YEARMODA        : Date, format: "2015-01-01" "2015-01-02" ...
+#>  $ YEAR            : chr  "2015" "2015" "2015" "2015" ...
+#>  $ MONTH           : chr  "01" "01" "01" "01" ...
+#>  $ DAY             : chr  "01" "02" "03" "04" ...
+#>  $ YDAY            : num  1 2 3 4 5 6 7 8 9 10 ...
+#>  $ TEMP            : num  26.9 27.2 26.3 27.3 27.3 26.7 28.1 28.7 27.6 27.8 ...
+#>  $ TEMP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
+#>  $ DEWP            : num  23.2 23.3 23.8 24.1 24.3 24 23.6 23.3 21.9 22.3 ...
+#>  $ DEWP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
+#>  $ SLP             : num  1004 1003 1003 1002 1001 ...
+#>  $ SLP_CNT         : int  16 16 16 16 16 16 16 16 16 16 ...
+#>  $ STP             : num  1002 1000 NA 999 998 ...
+#>  $ STP_CNT         : int  16 16 16 16 16 16 16 16 16 16 ...
+#>  $ VISIB           : num  NA NA NA NA NA NA NA NA NA NA ...
+#>  $ VISIB_CNT       : int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ WDSP            : num  1.7 2.2 1.7 2 2.6 3.4 4.5 5.9 4.4 2.4 ...
+#>  $ WDSP_CNT        : int  16 16 16 16 16 16 16 16 16 16 ...
+#>  $ MXSPD           : num  4.1 4.1 4.1 4.1 5.7 5.7 6.7 9.3 7.7 4.6 ...
+#>  $ GUST            : num  NA NA NA NA NA NA NA NA NA NA ...
+#>  $ MAX             : num  31.5 31.3 29.2 32.1 31.4 28.6 30.2 31 32.7 32.9 ...
+#>  $ MAX_FLAG        : chr  NA NA NA NA ...
+#>  $ MIN             : num  25 24.9 24.4 24.3 24.6 25.1 24.5 26.3 22.8 22.6 ...
+#>  $ MIN_FLAG        : chr  NA "*" "*" NA ...
+#>  $ PRCP            : num  16.5 12.4 5.1 20.3 41.1 20.1 82.3 2.3 6.1 27.4 ...
+#>  $ PRCP_FLAG       : chr  "G" "G" "G" "G" ...
+#>  $ SNDP            : num  NA NA NA NA NA NA NA NA NA NA ...
+#>  $ I_FOG           : int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ I_RAIN_DRIZZLE  : int  1 1 1 1 1 1 1 1 1 0 ...
+#>  $ I_SNOW_ICE      : int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ I_HAIL          : int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ I_THUNDER       : int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ I_TORNADO_FUNNEL: int  0 0 0 0 0 0 0 0 0 0 ...
+#>  $ EA              : num  2.8 2.9 2.9 3 3 3 2.9 2.9 2.6 2.7 ...
+#>  $ ES              : num  3.5 3.6 3.4 3.6 3.6 3.5 3.8 3.9 3.7 3.7 ...
+#>  $ RH              : num  80 80.6 85.3 83.3 83.3 85.7 76.3 74.4 70.3 73 ...
+#>  $ geometry        :sfc_POINT of length 186977; first list element: Classes 'XY', 'POINT', 'sfg'  num [1:2] 126.6 -14.3
+#>  - attr(*, "sf_column")= chr "geometry"
+#>  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA NA ...
+#>   ..- attr(*, "names")= chr  "USAF" "WBAN" "STNID" "STN_NAME" ...

Saving sf objects

Writing a shapefile is a simple matter.

-
write_sf(GSOD_SF, "GSOD.shp") # silently overwrites
+
write_sf(GSOD_SF, "GSOD.shp") # silently overwrites

As is writing a GeoPackage from the sf object.

-
write_sf(GSOD_SF, "~/GSOD.gpkg") # silently overwrites
+
write_sf(GSOD_SF, "~/GSOD.gpkg") # silently overwrites

After getting weather stations for Australia and creating a GeoPackage file, rgdal can import the data into R again in a spatial format.

Importing a GeoPackage file can be a bit tricky. The dsn will be the full path along with the file name. The layer to be specified is “GSOD”, this is specified in the get_GSOD() function and will not change. The file name, specified in the dsn will, but the layer name will not.

- +
library(rgdal)
+#> Loading required package: sp
+#> rgdal: version: 1.1-10, (SVN revision 622)
+#>  Geospatial Data Abstraction Library extensions to R successfully loaded
+#>  Loaded GDAL runtime: GDAL 1.11.5, released 2016/07/01
+#>  Path to GDAL shared files: /usr/local/Cellar/gdal/1.11.5_1/share/gdal
+#>  Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
+#>  Path to PROJ.4 shared files: (autodetected)
+#>  Linking to sp version: 1.2-3
+
+AUS_stations <- readOGR(dsn = path.expand("~/GSOD.gpkg"), layer = "GSOD")
+#> OGR data source with driver: GPKG
+#> Source: "/Users/asparks/AUS-2015.gpkg", layer: "GSOD"
+#> with 186977 features
+#> It has 46 fields
+
+class(AUS_stations)
+#> [1] "SpatialPointsDataFrame"
+#> attr(,"package")
+#> [1] "sp"

Since GeoPackage files are formatted as SQLite databases you can use the existing R tools for SQLite files (J. Stachelek 2016). One easy way is using dplyr. This option is much faster to load since it does not load the geometry.

- +
AUS_sqlite <- tbl(src_sqlite(path.expand("~/GSOD.gpkg")), "GSOD")
+class(AUS_sqlite)
+#> [1] "tbl_dbi"  "tbl_sql"  "tbl_lazy" "tbl"
@@ -455,14 +456,14 @@

Reformat a list of local files

- +
y <- c("~/GSOD/gsod_1960/200490-99999-1960.op.gz",
+       "~/GSOD/gsod_1961/200490-99999-1961.op.gz")
+x <- reformat_GSOD(file_list = y)

Reformat all local files found in directory

-
x <- reformat_GSOD(dsn = "~/GSOD/gsod_1960")
+
x <- reformat_GSOD(dsn = "~/GSOD/gsod_1960")

@@ -477,19 +478,19 @@

Using get_inventory()

GSODR provides a function, get_inventory() to retrieve an inventory of the number of weather observations by station-year-month for the beginning of record through to current.

Following is an example of how to retrieve the inventory and check a station in Toowoomba, Queensland, Australia, which was used in an earlier example.

- +
inventory <- get_inventory()
+
+inventory
+
+subset(inventory, STNID == "955510-99999")

Additional Climate Data Availability

Additional climate data, GSODRdata, formatted for use with GSOD data provided by GSODR are available as an R package, which can only be installed through GitHub due to the package size, 5.1Mb, being too large for CRAN.

- +
#install.packages("devtools")
+devtools::install_github("adamhsparks/GSODRdata")
+library("GSODRdata")

@@ -497,7 +498,7 @@

Elevation Values

-

90 metre (90m) hole-filled SRTM digital elevation (Jarvis et al. 2008) was used to identify and correct/remove elevation errors in data for station locations between -60˚ and 60˚ latitude. This applies to cases here where elevation was missing in the reported values as well. In case the station reported an elevation and the DEM does not, the station reported is taken. For stations beyond -60˚ and 60˚ latitude, the values are station reported values in every instance. See https://github.com/ropensci/GSODR/blob/master/data-raw/fetch_isd-history.md for more detail on the correction methods.

+

90 metre (90m) hole-filled SRTM digital elevation (Jarvis et al. 2008) was used to identify and correct/remove elevation errors in data for station locations between -60˚ and 60˚ latitude. This applies to cases here where elevation was missing in the reported values as well. In case the station reported an elevation and the DEM does not, the station reported is taken. For stations beyond -60˚ and 60˚ latitude, the values are station reported values in every instance. See https://github.com/ropensci/GSODR/blob/master/data-raw/fetch_isd-history.md for more detail on the correction methods.

@@ -528,7 +529,7 @@

  • LAT - Latitude. Station dropped in cases where values are < -90 or > 90 degrees or Lat = 0 and Lon = 0;

  • LON - Longitude. Station dropped in cases where values are < -180 or > 180 degrees or Lat = 0 and Lon = 0;

  • ELEV_M - Elevation in metres;

  • -
  • ELEV_M_SRTM_90m - Elevation in metres corrected for possible errors, derived from the CGIAR-CSI SRTM 90m database (Jarvis et al. 2008);

  • +
  • ELEV_M_SRTM_90m - Elevation in metres corrected for possible errors, derived from the CGIAR-CSI SRTM 90m database (Jarvis et al. 2008);

  • YEARMODA - Date in YYYY-mm-dd format;

  • YEAR - The year (YYYY);

  • MONTH - The month (mm);

  • @@ -644,9 +645,8 @@

    -

    Site built with pkgdown.

    +

    Site built with pkgdown 1.3.0.

    -

    diff --git a/docs/articles/GSODR_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/GSODR_files/figure-html/unnamed-chunk-12-1.png deleted file mode 100644 index 8aa9a239..00000000 Binary files a/docs/articles/GSODR_files/figure-html/unnamed-chunk-12-1.png and /dev/null differ diff --git a/docs/articles/GSODR_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/GSODR_files/figure-html/unnamed-chunk-13-1.png index 8aa9a239..90f325e1 100644 Binary files a/docs/articles/GSODR_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/GSODR_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/articles/GSODR_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/GSODR_files/figure-html/unnamed-chunk-5-1.png index 2bb9d71e..e740895e 100644 Binary files a/docs/articles/GSODR_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/GSODR_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/Working_with_spatial_and_climate_data.html b/docs/articles/Working_with_spatial_and_climate_data.html index 7c6f66ba..b4fc798e 100644 --- a/docs/articles/Working_with_spatial_and_climate_data.html +++ b/docs/articles/Working_with_spatial_and_climate_data.html @@ -1,19 +1,19 @@ - + Working with spatial and climate data from GSODR and GSODRdata • GSODR - - - + + + - @@ -23,14 +23,15 @@
    diff --git a/docs/articles/index.html b/docs/articles/index.html index 65d7e8fe..97960fc1 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,6 +1,6 @@ - + @@ -9,17 +9,17 @@ Articles • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + + GSODR use case: Finding specific stations using spatial queries • GSODR - - - + + + - @@ -23,14 +23,15 @@
    diff --git a/docs/authors.html b/docs/authors.html index 08b317f4..27253340 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,6 +1,6 @@ - + @@ -9,17 +9,17 @@ Citation and Authors • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + + Global Surface Summary of the Day ('GSOD') Weather Data Client • GSODR - - - + + + - @@ -40,14 +40,15 @@
    - +

    Development Version

    A development version is available from from GitHub. If you wish to install the development version that may have new features or bug fixes before the CRAN version does (but also may not work properly), please install the remotes package, available from CRAN. We strive to keep the master branch on GitHub functional and working properly.

    - +
    if (!require("remotes")) {
    +  install.packages("remotes", repos = "http://cran.rstudio.com/")
    +  library("remotes")
    +}
    +
    +install_github("ropensci/GSODR")
    @@ -165,7 +166,7 @@

    Elevation Values

    -

    90 m hole-filled SRTM digital elevation (Jarvis et al. 2008) was used to identify and correct/remove elevation errors in data for station locations between -60˚ and 60˚ latitude. This applies to cases here where elevation was missing in the reported values as well. In case the station reported an elevation and the DEM does not, the station reported is taken. For stations beyond -60˚ and 60˚ latitude, the values are station reported values in every instance. See https://github.com/ropensci/GSODR/blob/master/data-raw/fetch_isd-history.md for more detail on the correction methods.

    +

    90 m hole-filled SRTM digital elevation (Jarvis et al. 2008) was used to identify and correct/remove elevation errors in data for station locations between -60˚ and 60˚ latitude. This applies to cases here where elevation was missing in the reported values as well. In case the station reported an elevation and the DEM does not, the station reported is taken. For stations beyond -60˚ and 60˚ latitude, the values are station reported values in every instance. See https://github.com/ropensci/GSODR/blob/master/data-raw/fetch_isd-history.md for more detail on the correction methods.

    @@ -197,7 +198,7 @@

    - diff --git a/docs/issue_template.html b/docs/issue_template.html index bed3ca6f..493a4c36 100644 --- a/docs/issue_template.html +++ b/docs/issue_template.html @@ -1,6 +1,6 @@ - + @@ -9,17 +9,17 @@ NA • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ Changelog • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ NA • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ Global Surface Summary of the Day (<acronym>GSOD</acronym>) Weather Data Client — GSODR • GSODR - + - - + + - + - + @@ -53,7 +53,8 @@ - + + - + @@ -9,17 +9,17 @@ Download and Return a Tidy Data Frame of <acronym>GSOD</acronym> Weather Data — get_GSOD • GSODR - + - - + + - + - + @@ -40,7 +40,7 @@ in the final data frame. Parallel processing can be enabled using plan to set up a parallel backend of your choice, e.g., -future::plan(multisession). See examples for more." /> +future::plan("multisession"). See examples for more." /> @@ -48,7 +48,8 @@ - + + - + @@ -9,17 +9,17 @@ Download and Return a Tidy Data Frame of <acronym>GSOD</acronym> Weather Station Data Inventories — get_inventory • GSODR - + - - + + - + - + @@ -45,7 +45,8 @@ - + + - + @@ -9,17 +9,17 @@ Function reference • GSODR - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,17 +9,17 @@ Find Nearest <acronym>GSOD</acronym> Stations to a Specified Latitude and Longitude — nearest_stations • GSODR - + - - + + - + - + @@ -43,7 +43,8 @@ - + + - + @@ -9,17 +9,17 @@ Prints GSODR.info object. — print.GSODR.Info • GSODR - + - - + + - + - + @@ -40,7 +40,8 @@ - + + - + @@ -9,17 +9,17 @@ Tidy and Return a Data Frame of <acronym>GSOD</acronym> Weather from Local Data — reformat_GSOD • GSODR - + - - + + - + - + @@ -52,7 +52,8 @@ - + + - + @@ -9,17 +9,17 @@ Download Latest Station List Information and Update Internal Database — update_station_list • GSODR - + - - + + - + - + @@ -45,7 +45,8 @@ - + +