From 15e8a6dca3f4462ba7c7e82e69a5c4fb8b8fdadc Mon Sep 17 00:00:00 2001 From: Jonathan Callahan Date: Wed, 20 Jan 2021 06:45:28 -0800 Subject: [PATCH] feat: updated to latest geodist, MazamaSpatialUtils This revision also fixes issues with not being able to run R CMD check --run-donttest by having mazama_initialize() install the required datasets. --- DESCRIPTION | 12 +- NEWS.md | 10 + R/MazamaLocationUtils.R | 8 +- R/location_getSingleAddress_Photon.R | 33 +-- R/location_getSingleAddress_TexasAM.R | 19 +- R/location_getSingleElevation_USGS.R | 17 +- R/location_initialize.R | 38 ++-- R/mazama_initialize.R | 29 ++- R/table_addLocation.R | 2 + R/table_addSingleLocation.R | 2 +- R/table_findOverlappingLocations.R | 2 +- R/table_getNearestLocation.R | 21 +- R/table_initializeExisting.R | 2 +- docs/404.html | 34 ++- docs/LICENSE-text.html | 34 ++- docs/articles/MazamaLocationUtils.html | 209 +++++++++--------- .../anchor-sections-1.0/anchor-sections.css | 4 + .../anchor-sections-1.0/anchor-sections.js | 33 +++ .../header-attrs-2.5/header-attrs.js | 12 + docs/articles/index.html | 35 +-- docs/authors.html | 28 ++- docs/bootstrap-toc.css | 60 +++++ docs/bootstrap-toc.js | 159 +++++++++++++ docs/index.html | 22 +- docs/news/index.html | 137 ++++++------ docs/pkgdown.css | 125 ++++++++++- docs/pkgdown.js | 5 - docs/pkgdown.yml | 5 +- docs/reference/LocationDataDir.html | 40 ++-- docs/reference/MazamaLocationUtils.html | 39 ++-- docs/reference/Rplot001.png | Bin 0 -> 1011 bytes docs/reference/apiKeys.html | 40 ++-- docs/reference/coreMetadataNames.html | 42 ++-- docs/reference/getAPIKey.html | 43 ++-- docs/reference/getLocationDataDir.html | 42 ++-- docs/reference/id_monitors_500.html | 54 ++--- docs/reference/index.html | 42 ++-- docs/reference/location_createID.html | 69 +++--- docs/reference/location_getCensusBlock.html | 57 +++-- .../location_getSingleAddress_Photon.html | 123 +++++------ .../location_getSingleAddress_TexasAM.html | 89 ++++---- .../location_getSingleElevation_USGS.html | 62 +++--- docs/reference/location_initialize.html | 101 +++------ docs/reference/mazama_initialize.html | 72 +++--- docs/reference/or_monitors_500.html | 54 ++--- docs/reference/pipe.html | 40 ++-- docs/reference/setAPIKey.html | 43 ++-- docs/reference/setLocationDataDir.html | 43 ++-- docs/reference/table_addColumn.html | 74 +++---- docs/reference/table_addLocation.html | 102 +++++---- docs/reference/table_addSingleLocation.html | 84 +++---- docs/reference/table_export.html | 50 ++--- .../table_findOverlappingLocations.html | 76 +++---- docs/reference/table_getLocationID.html | 65 +++--- docs/reference/table_getNearestDistance.html | 67 +++--- docs/reference/table_getNearestLocation.html | 67 +++--- docs/reference/table_getRecordIndex.html | 58 ++--- docs/reference/table_initialize.html | 49 ++-- docs/reference/table_initializeExisting.html | 54 ++--- docs/reference/table_load.html | 63 +++--- docs/reference/table_removeColumn.html | 82 +++---- docs/reference/table_removeRecord.html | 65 +++--- docs/reference/table_save.html | 76 +++---- docs/reference/table_updateColumn.html | 80 +++---- docs/reference/table_updateSingleRecord.html | 88 ++++---- docs/reference/validateLonLat.html | 42 ++-- docs/reference/validateLonsLats.html | 42 ++-- .../reference/validateMazamaSpatialUtils.html | 41 ++-- docs/reference/wa_airfire_meta.html | 49 ++-- docs/reference/wa_monitors_500.html | 54 ++--- man/location_getSingleAddress_Photon.Rd | 5 +- man/location_getSingleAddress_TexasAM.Rd | 3 +- man/location_getSingleElevation_USGS.Rd | 1 + man/mazama_initialize.Rd | 3 - man/table_addLocation.Rd | 2 + man/table_addSingleLocation.Rd | 2 +- .../test-table_findOverlappingLocations.R | 3 +- 77 files changed, 2036 insertions(+), 1603 deletions(-) create mode 100644 docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.css create mode 100644 docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.js create mode 100644 docs/articles/MazamaLocationUtils_files/header-attrs-2.5/header-attrs.js create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js create mode 100644 docs/reference/Rplot001.png diff --git a/DESCRIPTION b/DESCRIPTION index 2f76c78..fa3702e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,13 @@ Type: Package Package: MazamaLocationUtils -Version: 0.1.11 +Version: 0.1.12 Title: Manage Spatial Metadata for Known Locations Authors@R: c( person("Jonathan", "Callahan", email="jonathan.s.callahan@gmail.com", role=c("aut","cre")), person("Eli", "Grosman", email="eligrosman1@gmail.com", role=c("aut")) ) Author: Jonathan Callahan [aut, cre], - Eli Grosman [aut], - Oliver Fogelin [aut] + Eli Grosman [aut] Maintainer: Jonathan Callahan Description: A suite of utility functions for discovering and managing metadata associated with sets of spatially unique "known locations". @@ -16,20 +15,19 @@ License: GPL-3 URL: https://github.com/MazamaScience/MazamaLocationUtils BugReports: https://github.com/MazamaScience/MazamaLocationUtils/issues Depends: - R (>= 3.1.0) + R (>= 3.5) Imports: digest, dplyr, - geodist, + geodist (>= 0.0.6.007), httr, jsonlite, lubridate, methods, magrittr, MazamaCoreUtils, - MazamaSpatialUtils, + MazamaSpatialUtils (>= 0.7), readr, - revgeo, rlang, stringr Suggests: diff --git a/NEWS.md b/NEWS.md index 1be22af..c441c52 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# MazamaLocationUtils 0.1.12 + +* Updated `location_getSingleAddress_Photon()` to remove **revgeo** dependency. +* Updated requirements to **geodist** 0.0.6.007 to handle errors finding longitude +and latitude columns in the passed in tibble. +* `geodist::geodist()` is now always called with `measure = "geodesic"` to avoid +warning messages from `geodist()` about inaccuracies with `measure = "cheap" +(the default). +* `mazama_initialize()` now installs required datasets if they are missing. + # MazamaLocationUtils 0.1.11 * Added unit test for `table_findOverlappingLocations()`. diff --git a/R/MazamaLocationUtils.R b/R/MazamaLocationUtils.R index 7e7e2f2..5123e4e 100644 --- a/R/MazamaLocationUtils.R +++ b/R/MazamaLocationUtils.R @@ -96,10 +96,10 @@ coreMetadataNames <- c( "stateCode", # from MazamaSpatialUtils::getStateCode() "county", # from MazamaSpatialUtils::getUSCounty() "timezone", # from MazamaSpatialUtils::getTimezone() - "houseNumber", # from http://photon.komoot.de/ - "street", # from http://photon.komoot.de/ - "city", # from http://photon.komoot.de/ - "zip" # from http://photon.komoot.de/ + "houseNumber", # from http://photon.komoot.io/ + "street", # from http://photon.komoot.io/ + "city", # from http://photon.komoot.io/ + "zip" # from http://photon.komoot.io/ ) # ----- Internal Package State ------------------------------------------------- diff --git a/R/location_getSingleAddress_Photon.R b/R/location_getSingleAddress_Photon.R index f4a7524..15604a9 100644 --- a/R/location_getSingleAddress_Photon.R +++ b/R/location_getSingleAddress_Photon.R @@ -1,8 +1,22 @@ - +#' @rdname location_getSingleAddress_Photon +#' @export +#' @importFrom utils capture.output +#' @importFrom jsonlite fromJSON +#' @importFrom stringr str_detect str_sub str_subset +#' #' @title Get address data from the Photon API to OpenStreetMap +#' +#' @param longitude Single longitude in decimal degrees E, Default: NULL +#' @param latitude Single latitude in decimal degrees N, Default: NULL +#' @param baseUrl Base URL for data queries. +#' @param verbose Logical controlling the generation of progress messages. +#' +#' @return List of address components. +#' #' @description The Photon API is used get address data associated with #' the \code{longitude} and \code{latitude}. The following list of data #' is returned: +#' #' \itemize{ #' \item{\code{houseNumber}} #' \item{\code{street}} @@ -13,16 +27,13 @@ #' \item{\code{countryCode}} #' \item{\code{countryName}} #' } +#' #' The function makes an effort to convert both \code{state} and \code{country} #' \code{Name} into \code{Code} with codes defaulting to \code{NA}. Both #' \code{Name} and \code{Code} are returned so that improvements can be made in #' the conversion algorithm. -#' @param longitude Single longitude in decimal degrees E, Default: NULL -#' @param latitude Single latitude in decimal degrees N, Default: NULL -#' @param baseUrl Base URL for data queries. -#' @param verbose Logical controlling the generation of progress messages. -#' @return List of address components. -#' @examples +#' +#' @examples #' \donttest{ #' library(MazamaLocationUtils) #' @@ -36,12 +47,8 @@ #' addressList <- location_getSingleAddress_Photon(lon, lat) #' str(addressList) #' } -#' @references \url{http://photon.komoot.de} -#' @rdname location_getSingleAddress_Photon -#' @export -#' @importFrom utils capture.output -#' @importFrom jsonlite fromJSON -#' @importFrom stringr str_detect str_sub str_subset +#' +#' @references \url{http://photon.komoot.io} #' location_getSingleAddress_Photon <- function( longitude = NULL, diff --git a/R/location_getSingleAddress_TexasAM.R b/R/location_getSingleAddress_TexasAM.R index 73bd5f1..59f0da3 100644 --- a/R/location_getSingleAddress_TexasAM.R +++ b/R/location_getSingleAddress_TexasAM.R @@ -1,15 +1,21 @@ - +#' @rdname location_getSingleAddress_TexasAM +#' @export +#' #' @title Get an address from a Texas A&M web service -#' @description Texas A&M APIs are used to determine the address associated with -#' the \code{longitude} and \code{latitude}. +#' #' @param longitude Single longitude in decimal degrees E, Default: NULL #' @param latitude Single latitude in decimal degrees N, Default: NULL #' @param verbose Logical controlling the generation of progress messages. #' @param apiKey Texas A&M Geocoding requires an API key. The first 2500 requests #' are free. Default: NULL +#' #' @return Numeric elevation value. -#' @examples -#' \donttest{ +#' +#' @description Texas A&M APIs are used to determine the address associated with +#' the \code{longitude} and \code{latitude}. +#' +#' @examples +#' \dontrun{ #' library(MazamaLocationUtils) #' #' # Set up standard directories and spatial data @@ -23,9 +29,8 @@ #' #' location_getSingleAddress_TexasAM(longitude, latitude, apiKey) #' } +#' #' @references \url{https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP.aspx} -#' @rdname location_getSingleAddress_TexasAM -#' @export #' location_getSingleAddress_TexasAM <- function( longitude = NULL, diff --git a/R/location_getSingleElevation_USGS.R b/R/location_getSingleElevation_USGS.R index 3170bc6..411fe3a 100644 --- a/R/location_getSingleElevation_USGS.R +++ b/R/location_getSingleElevation_USGS.R @@ -1,12 +1,18 @@ - +#' @rdname location_getSingleElevation_USGS +#' @export +#' #' @title Get elevation data from a USGS web service -#' @description USGS APIs are used to determine the elevation associated with -#' the \code{longitude} and \code{latitude}. +#' #' @param longitude Single longitude in decimal degrees E, Default: NULL #' @param latitude Single latitude in decimal degrees N, Default: NULL #' @param verbose Logical controlling the generation of progress messages. +#' #' @return Numeric elevation value. -#' @examples +#' +#' @description USGS APIs are used to determine the elevation associated with +#' the \code{longitude} and \code{latitude}. +#' +#' @examples #' \donttest{ #' library(MazamaLocationUtils) #' @@ -15,9 +21,8 @@ #' lat <- 47.423333 #' location_getSingleElevation_USGS(lon, lat) #' } +#' #' @references \url{https://nationalmap.gov/epqs/} -#' @rdname location_getSingleElevation_USGS -#' @export #' location_getSingleElevation_USGS <- function( longitude = NULL, diff --git a/R/location_initialize.R b/R/location_initialize.R index e536c8b..765cb40 100644 --- a/R/location_initialize.R +++ b/R/location_initialize.R @@ -1,6 +1,23 @@ - +#' @rdname location_initialize +#' @export +#' @importFrom MazamaCoreUtils stopIfNull +#' @importFrom MazamaSpatialUtils getCountryCode getStateCode getTimezone +#' @importFrom dplyr tibble +#' @importFrom stringr str_sub +#' #' @title Create known location record with core metadata #' +#' @param longitude Single longitude in decimal degrees E, Default: NULL +#' @param latitude Single latitude in decimal degrees N, Default: NULL +#' @param stateDataset Name of spatial dataset to use for determining state +#' @param elevationService Name of the elevation service to use for determining +#' the elevation. Default: NULL. Accepted values: "usgs". +#' @param addressService Name of the address service to use for determining +#' the street address. Default: NULL Accepted values: "photon". +#' @param verbose Logical controlling the generation of progress messages. +#' +#' @return Tibble with a single new known location. +#' #' @description Creates a known location record with the following columns #' of core metadata: #' \itemize{ @@ -19,19 +36,6 @@ #' \item{zip} #' } #' -#' @param longitude Single longitude in decimal degrees E, Default: NULL -#' @param latitude Single latitude in decimal degrees N, Default: NULL -#' @param stateDataset Name of spatial dataset to use for determining state -#' @param elevationService Name of the elevation service to use for determining -#' the elevation. Default: NULL. Accepted values: "usgs". -#' @param addressService Name of the address service to use for determining -#' the street address. Default: NULL Accepted values: "photon". -#' @param verbose Logical controlling the generation of progress messages. -#' -#' @return Tibble with a single new known location. -#' -#' @rdname location_initialize -#' #' @examples #' \donttest{ #' library(MazamaLocationUtils) @@ -45,11 +49,7 @@ #' lat <- 47.423333 #' locationRecord <- location_initialize(lon, lat) #' } -#' @export -#' @importFrom MazamaCoreUtils stopIfNull -#' @importFrom MazamaSpatialUtils getCountryCode getStateCode getTimezone -#' @importFrom dplyr tibble -#' @importFrom stringr str_sub + location_initialize <- function( longitude = NULL, latitude = NULL, diff --git a/R/mazama_initialize.R b/R/mazama_initialize.R index 964b022..738d035 100644 --- a/R/mazama_initialize.R +++ b/R/mazama_initialize.R @@ -1,5 +1,15 @@ - +#' @rdname mazama_initialize +#' +#' @export +#' @importFrom MazamaSpatialUtils setSpatialDataDir loadSpatialData +#' #' @title Initialize with MazamaScience standard directories +#' +#' @param spatialDataDir Directory where spatial datasets are found, +#' Default: "~/Data/Spatial" +#' +#' @return No return value. +#' #' @description Convenience function to initialize spatial data. Wraps the #' following setup lines: #' @@ -11,10 +21,7 @@ #' MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") #' MazamaSpatialUtils::loadSpatialData("USCensusCounties") #' } -#' @param spatialDataDir Directory where spatial datasets are found, -#' Default: "~/Data/Spatial" -#' @return No return value. -#' @rdname mazama_initialize +#' #' @examples #' \donttest{ #' library(MazamaLocationUtils) @@ -23,17 +30,11 @@ #' spatialDataDir <- tempdir() # typically "~/Data/Spatial" #' MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) #' -#' # Install core spatial datasets (168 MB download) -#' MazamaSpatialUtils::installSpatialData() -#' #' exists("NaturalEarthAdm1") #' mazama_initialize(spatialDataDir) #' exists("NaturalEarthAdm1") #' class(NaturalEarthAdm1) #' } -#' @export -#' @importFrom MazamaSpatialUtils setSpatialDataDir loadSpatialData -#' mazama_initialize <- function( spatialDataDir = "~/Data/Spatial" ) { @@ -48,6 +49,12 @@ mazama_initialize <- function( # Not initialized, so try to initialize result <- try({ MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) + # Install if not found + MazamaSpatialUtils::installSpatialData("EEZCountries") + MazamaSpatialUtils::installSpatialData("OSMTimezones") + MazamaSpatialUtils::installSpatialData("NaturalEarthAdm1") + MazamaSpatialUtils::installSpatialData("USCensusCounties") + # Now load MazamaSpatialUtils::loadSpatialData("EEZCountries") MazamaSpatialUtils::loadSpatialData("OSMTimezones") MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") diff --git a/R/table_addLocation.R b/R/table_addLocation.R index 17eb5e7..6967f64 100644 --- a/R/table_addLocation.R +++ b/R/table_addLocation.R @@ -39,6 +39,8 @@ #' locationTbl <- #' locationTbl %>% #' table_addLocation(lon, lat, radius = 500) +#' +#' dplyr::glimpse(locationTbl) #' } #' @seealso \link{table_addSingleLocation} #' @seealso \link{table_removeRecord} diff --git a/R/table_addSingleLocation.R b/R/table_addSingleLocation.R index d3796ec..9d78ffc 100644 --- a/R/table_addSingleLocation.R +++ b/R/table_addSingleLocation.R @@ -26,7 +26,7 @@ #' #' # Set up standard directories and spatial data #' spatialDataDir <- tempdir() # typically "~/Data/Spatial" -#' MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) +#' mazama_initialize(spatialDataDir) #' #' locationTbl <- get(data("wa_monitors_500")) #' diff --git a/R/table_findOverlappingLocations.R b/R/table_findOverlappingLocations.R index f0561a1..6ec126e 100644 --- a/R/table_findOverlappingLocations.R +++ b/R/table_findOverlappingLocations.R @@ -69,7 +69,7 @@ table_findOverlappingLocations <- function( # ----- Check for locations that are too close ------------------------------- # Calculate distances between each location - distances <- geodist::geodist(tbl) + distances <- geodist::geodist(tbl, measure = "geodesic") # Get distances that are less than the given diameter # NOTE: the distance between a location and itself is always zero diff --git a/R/table_getNearestLocation.R b/R/table_getNearestLocation.R index 02d7a09..73ef0b4 100644 --- a/R/table_getNearestLocation.R +++ b/R/table_getNearestLocation.R @@ -1,13 +1,20 @@ - +#' @rdname table_getNearestLocation +#' @export +#' @importFrom MazamaCoreUtils stopIfNull +#' #' @title Return known locations -#' @description Returns a tibble of known locations from \code{locationTbl}, one -#' for each incoming location. If no known location is found for a particular -#' incoming location, that record in the tibble will contain all \code{NA}. +#' #' @param locationTbl Tibble of known locations, Default: NULL #' @param longitude Vector of longitudes in decimal degrees E, Default: NULL #' @param latitude Vector of latitudes in decimal degrees N, Default: NULL #' @param radius Radius in meters, Default: NULL +#' #' @return Tibble of known locations. +#' +#' @description Returns a tibble of known locations from \code{locationTbl}, one +#' for each incoming location. If no known location is found for a particular +#' incoming location, that record in the tibble will contain all \code{NA}. +#' #' @examples #' library(MazamaLocationUtils) #' @@ -22,11 +29,7 @@ #' #' # Expanding the radius will find one #' table_getNearestLocation(locationTbl, lon, lat, radius = 5000) %>% str() -#' @rdname table_getNearestLocation -#' @export -#' @importFrom MazamaCoreUtils stopIfNull -#' @importFrom geodist geodist -#' @importFrom rlang .data + table_getNearestLocation <- function( locationTbl = NULL, longitude = NULL, diff --git a/R/table_initializeExisting.R b/R/table_initializeExisting.R index c4c8e01..f808be8 100644 --- a/R/table_initializeExisting.R +++ b/R/table_initializeExisting.R @@ -254,7 +254,7 @@ table_initializeExisting <- function( # ----- Check for locations that are too close ------------------------------- # Calculate distances between each location - distances <- geodist::geodist(locationTbl) + distances <- geodist::geodist(locationTbl, measure = "geodesic") # Get distances that are less than the given diameter # NOTE: the distance between a location and itself is always zero diff --git a/docs/404.html b/docs/404.html index 32cf225..697ac32 100644 --- a/docs/404.html +++ b/docs/404.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -91,7 +95,7 @@
+ + @@ -126,7 +136,7 @@

Page not found (404)

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4850882..f89cd39 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -91,7 +95,7 @@
+ + @@ -800,7 +810,7 @@

License

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/articles/MazamaLocationUtils.html b/docs/articles/MazamaLocationUtils.html index f8ca5a0..639d19e 100644 --- a/docs/articles/MazamaLocationUtils.html +++ b/docs/articles/MazamaLocationUtils.html @@ -6,19 +6,19 @@ Introduction to MazamaLocationUtils • MazamaLocationUtils - - - - + + + + + - - + - +
+ +
- @@ -286,7 +289,7 @@

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.css b/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.css new file mode 100644 index 0000000..07aee5f --- /dev/null +++ b/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.css @@ -0,0 +1,4 @@ +/* Styles for section anchors */ +a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} +a.anchor-section::before {content: '#';} +.hasAnchor:hover a.anchor-section {visibility: visible;} diff --git a/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.js b/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.js new file mode 100644 index 0000000..570f99a --- /dev/null +++ b/docs/articles/MazamaLocationUtils_files/anchor-sections-1.0/anchor-sections.js @@ -0,0 +1,33 @@ +// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. +document.addEventListener('DOMContentLoaded', function() { + // Do nothing if AnchorJS is used + if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { + return; + } + + const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); + + // Do nothing if sections are already anchored + if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { + return null; + } + + // Use section id when pandoc runs with --section-divs + const section_id = function(x) { + return ((x.classList.contains('section') || (x.tagName === 'SECTION')) + ? x.id : ''); + }; + + // Add anchors + h.forEach(function(x) { + const id = x.id || section_id(x.parentElement); + if (id === '') { + return null; + } + let anchor = document.createElement('a'); + anchor.href = '#' + id; + anchor.classList = ['anchor-section']; + x.classList.add('hasAnchor'); + x.appendChild(anchor); + }); +}); diff --git a/docs/articles/MazamaLocationUtils_files/header-attrs-2.5/header-attrs.js b/docs/articles/MazamaLocationUtils_files/header-attrs-2.5/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/MazamaLocationUtils_files/header-attrs-2.5/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/index.html b/docs/articles/index.html index 5d34740..f95c103 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -91,7 +95,7 @@
@@ -130,7 +135,7 @@

All vignettes

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/authors.html b/docs/authors.html index c9dc08f..83a70dc 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -91,7 +95,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index e75c5e1..7022d99 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,20 +6,20 @@ Manage Spatial Metadata for Known Locations • MazamaLocationUtils - - - - + + + + + - - +
    -
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/MazamaLocationUtils.html b/docs/reference/MazamaLocationUtils.html index 9bc71e4..c8bc9ef 100644 --- a/docs/reference/MazamaLocationUtils.html +++ b/docs/reference/MazamaLocationUtils.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -42,7 +46,6 @@ associated with fixed locations in space. The motivating fields include both air and water quality monitoring where fixed sensors report at regular time intervals." /> - @@ -60,7 +63,7 @@ - +
    @@ -98,7 +101,7 @@
    - @@ -208,7 +209,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000000000000000000000000000000000000..17a358060aed2a86950757bbd25c6f92c08c458f GIT binary patch literal 1011 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0x7m6Z+90U4Fo@(ch>_c&H|6f zVg?3oArNM~bhqvg0|WD9PZ!6KiaBo&GBN^{G%5UFpXcEKVvd5*5Eu=C0SJK)8A6*F U7`aXvEC5;V>FVdQ&MBb@00SN#Z2$lO literal 0 HcmV?d00001 diff --git a/docs/reference/apiKeys.html b/docs/reference/apiKeys.html index 7112c6f..9c8417a 100644 --- a/docs/reference/apiKeys.html +++ b/docs/reference/apiKeys.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -48,7 +52,6 @@ "custom2" " /> - @@ -66,7 +69,7 @@ - +
    @@ -104,7 +107,7 @@
    - @@ -170,7 +170,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/coreMetadataNames.html b/docs/reference/coreMetadataNames.html index ddb1105..fd075c3 100644 --- a/docs/reference/coreMetadataNames.html +++ b/docs/reference/coreMetadataNames.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    coreMetadataNames
    +
    coreMetadataNames

    Format

    @@ -133,13 +136,10 @@

    Details

    coreMetadataNames

    - @@ -150,7 +150,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/getAPIKey.html b/docs/reference/getAPIKey.html index a87c0d8..63b275f 100644 --- a/docs/reference/getAPIKey.html +++ b/docs/reference/getAPIKey.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    getAPIKey(provider = NULL)
    +
    getAPIKey(provider = NULL)

    Arguments

    @@ -144,14 +147,10 @@

    See a

    setAPIKey

    - @@ -162,7 +161,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/getLocationDataDir.html b/docs/reference/getLocationDataDir.html index 27bd68e..9061f6d 100644 --- a/docs/reference/getLocationDataDir.html +++ b/docs/reference/getLocationDataDir.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    getLocationDataDir()
    +
    getLocationDataDir()

    Value

    @@ -132,13 +135,10 @@

    See a

    setLocationDataDir

    - @@ -149,7 +149,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/id_monitors_500.html b/docs/reference/id_monitors_500.html index 9db75a0..da9077a 100644 --- a/docs/reference/id_monitors_500.html +++ b/docs/reference/id_monitors_500.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -46,16 +50,15 @@ mazama_initialize() setLocationDataDir("./data") -monitor &lt;- monitor_loadLatest() +monitor &lt;- monitor_loadLatest() &lt;!-- %&gt;% monitor_subset(stateCodes = "ID") --&gt; lons &lt;- monitor$meta$longitude lats &lt;- monitor$meta$latitude -table_initialize() - table_addLocation(lons, lats, radius = 500) +table_initialize() &lt;!-- %&gt;% --&gt; + table_addLocation(lons, lats, radius = 500) &lt;!-- %&gt;% --&gt; table_save("id_monitors_500") " /> - @@ -73,7 +76,7 @@ - +
    @@ -111,7 +114,7 @@
    -
    id_monitors_500
    +
    id_monitors_500

    Format

    @@ -168,13 +171,10 @@

    See a

    wa_monitors_500

    - @@ -185,7 +185,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 6d82629..c38ddbd 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
    @@ -91,7 +95,7 @@
    + +
    @@ -366,11 +375,10 @@

    -

    Contents

    -
    + @@ -381,7 +389,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_createID.html b/docs/reference/location_createID.html index dcbe5dc..3b21b99 100644 --- a/docs/reference/location_createID.html +++ b/docs/reference/location_createID.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -51,7 +55,6 @@ locationID &lt;- digest::digest(locationString, algo = "xxhash64") " /> - @@ -69,7 +72,7 @@ - +
    @@ -107,7 +110,7 @@
    -
    location_createID(longitude = NULL, latitude = NULL)
    +
    location_createID(longitude = NULL, latitude = NULL)

    Arguments

    @@ -172,22 +175,18 @@

    R

    https://www.johndcook.com/blog/2017/01/10/probability-of-secure-hash-collisions/

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 -locationID <- location_createID(lon, lat)
    +lon <- -120.325278 +lat <- 47.423333 +locationID <- location_createID(lon, lat) +
    - @@ -198,7 +197,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_getCensusBlock.html b/docs/reference/location_getCensusBlock.html index 01915e9..8691dd6 100644 --- a/docs/reference/location_getCensusBlock.html +++ b/docs/reference/location_getCensusBlock.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -44,7 +48,6 @@ censusBlock The data from this function should be considered to be the gold standard for state and county. i.e. this information could and should be used to override information we get elsewhere." /> - @@ -62,7 +65,7 @@ - +
    @@ -100,7 +103,7 @@
    -
    location_getCensusBlock(longitude = NULL, latitude = NULL, verbose = TRUE)
    +
    location_getCensusBlock(longitude = NULL, latitude = NULL, verbose = TRUE)

    Arguments

    @@ -162,27 +165,23 @@

    R

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) -lon <- -77.51 -lat <- 38.26 +lon <- -77.51 +lat <- 38.26 -censusList <- location_getCensusBlock(lon, lat) -str(censusList)
    #> List of 3 +censusList <- location_getCensusBlock(lon, lat) +str(censusList) +
    #> List of 3 #> $ stateCode : chr "VA" #> $ county : chr "Spotsylvania" -#> $ censusBlock: chr "511770203042000"
    # } +#> $ censusBlock: chr "511770203042000"
    # }
    - @@ -193,7 +192,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_getSingleAddress_Photon.html b/docs/reference/location_getSingleAddress_Photon.html index 3077aea..b0e51ab 100644 --- a/docs/reference/location_getSingleAddress_Photon.html +++ b/docs/reference/location_getSingleAddress_Photon.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,6 +43,7 @@ - @@ -69,7 +75,7 @@ - +
    @@ -107,7 +113,7 @@
    @@ -165,6 +175,10 @@

    Arg

    + + + + @@ -176,60 +190,37 @@

    Value

    List of address components.

    References

    -

    http://photon.komoot.de

    +

    http://photon.komoot.io

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Set up standard directories and spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -mazama_initialize(spatialDataDir)
    #> Error in validateMazamaSpatialUtils(): -#> -#> You must have the MazamaSpatialUtils package as well as core datasets installed. -#> -#> Install core datasets with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::installSpatialData() -#> -#> Once installed, initialize spatial data with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::loadSpatialData("EEZCountries") -#> MazamaSpatialUtils::loadSpatialData("OSMTimezones") -#> MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") -#> MazamaSpatialUtils::loadSpatialData("USCensusCounties")
    +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +mazama_initialize(spatialDataDir) + # Wenatchee -lon <- -120.325278 -lat <- 47.423333 -addressList <- location_getSingleAddress_Photon(lon, lat)
    #> Error in validateMazamaSpatialUtils(): -#> -#> You must have the MazamaSpatialUtils package as well as core datasets installed. -#> -#> Install core datasets with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::installSpatialData() -#> -#> Once installed, initialize spatial data with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::loadSpatialData("EEZCountries") -#> MazamaSpatialUtils::loadSpatialData("OSMTimezones") -#> MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") -#> MazamaSpatialUtils::loadSpatialData("USCensusCounties")
    str(addressList)
    #> Error in str(addressList): object 'addressList' not found
    # } +lon <- -120.325278 +lat <- 47.423333 +addressList <- location_getSingleAddress_Photon(lon, lat) +str(addressList) +
    #> List of 8 +#> $ houseNumber: chr NA +#> $ street : chr NA +#> $ city : chr "Wenatchee" +#> $ stateName : chr "Washington" +#> $ stateCode : chr "WA" +#> $ zip : chr "98801" +#> $ countryName: chr "United States" +#> $ countryCode: chr "US"
    # } +
    - @@ -240,7 +231,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_getSingleAddress_TexasAM.html b/docs/reference/location_getSingleAddress_TexasAM.html index 45d92bb..3dcf5d6 100644 --- a/docs/reference/location_getSingleAddress_TexasAM.html +++ b/docs/reference/location_getSingleAddress_TexasAM.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    location_getSingleAddress_TexasAM(
    -  longitude = NULL,
    -  latitude = NULL,
    -  apiKey = NULL,
    -  verbose = TRUE
    -)
    +
    location_getSingleAddress_TexasAM(
    +  longitude = NULL,
    +  latitude = NULL,
    +  apiKey = NULL,
    +  verbose = TRUE
    +)

    Arguments

    latitude

    Single latitude in decimal degrees N, Default: NULL

    baseUrl

    Base URL for data queries.

    verbose

    Logical controlling the generation of progress messages.

    @@ -159,43 +162,27 @@

    R

    https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP.aspx

    Examples

    -
    # \donttest{ -library(MazamaLocationUtils) +
    if (FALSE) { +library(MazamaLocationUtils) # Set up standard directories and spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -mazama_initialize(spatialDataDir)
    #> Error in validateMazamaSpatialUtils(): -#> -#> You must have the MazamaSpatialUtils package as well as core datasets installed. -#> -#> Install core datasets with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::installSpatialData() -#> -#> Once installed, initialize spatial data with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::loadSpatialData("EEZCountries") -#> MazamaSpatialUtils::loadSpatialData("OSMTimezones") -#> MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") -#> MazamaSpatialUtils::loadSpatialData("USCensusCounties")
    +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +mazama_initialize(spatialDataDir) + # Wenatchee -longitude <- -122.47 -latitude <- 47.47 -apiKey <- YOUR_PERSONAL_API_KEY
    #> Error in eval(expr, envir, enclos): object 'YOUR_PERSONAL_API_KEY' not found
    -location_getSingleAddress_TexasAM(longitude, latitude, apiKey)
    #> Error in MazamaCoreUtils::stopIfNull(apiKey): object 'apiKey' not found
    # } +longitude <- -122.47 +latitude <- 47.47 +apiKey <- YOUR_PERSONAL_API_KEY + +location_getSingleAddress_TexasAM(longitude, latitude, apiKey) +} +
    - @@ -206,7 +193,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_getSingleElevation_USGS.html b/docs/reference/location_getSingleElevation_USGS.html index 709b050..f22e4d9 100644 --- a/docs/reference/location_getSingleElevation_USGS.html +++ b/docs/reference/location_getSingleElevation_USGS.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    location_getSingleElevation_USGS(
    -  longitude = NULL,
    -  latitude = NULL,
    -  verbose = TRUE
    -)
    +
    location_getSingleElevation_USGS(
    +  longitude = NULL,
    +  latitude = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -154,23 +157,20 @@

    R

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 -location_getSingleElevation_USGS(lon, lat)
    #> [1] 236.03
    # } +lon <- -120.325278 +lat <- 47.423333 +location_getSingleElevation_USGS(lon, lat) +
    #> [1] 236.03
    # } +
    - @@ -181,7 +181,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/location_initialize.html b/docs/reference/location_initialize.html index 90e7429..02a186c 100644 --- a/docs/reference/location_initialize.html +++ b/docs/reference/location_initialize.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,6 @@ zip " /> - @@ -71,7 +74,7 @@ - +
    @@ -109,7 +112,7 @@
    -
    location_initialize(
    -  longitude = NULL,
    -  latitude = NULL,
    -  stateDataset = "NaturalEarthAdm1",
    -  elevationService = NULL,
    -  addressService = NULL,
    -  verbose = TRUE
    -)
    +
    location_initialize(
    +  longitude = NULL,
    +  latitude = NULL,
    +  stateDataset = "NaturalEarthAdm1",
    +  elevationService = NULL,
    +  addressService = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -198,55 +201,23 @@

    Value

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Set up standard directories and spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -mazama_initialize(spatialDataDir)
    #> Error in validateMazamaSpatialUtils(): -#> -#> You must have the MazamaSpatialUtils package as well as core datasets installed. -#> -#> Install core datasets with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::installSpatialData() -#> -#> Once installed, initialize spatial data with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::loadSpatialData("EEZCountries") -#> MazamaSpatialUtils::loadSpatialData("OSMTimezones") -#> MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") -#> MazamaSpatialUtils::loadSpatialData("USCensusCounties")
    +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +mazama_initialize(spatialDataDir) + # Wenatchee -lon <- -120.325278 -lat <- 47.423333 -locationRecord <- location_initialize(lon, lat)
    #> Error in validateMazamaSpatialUtils(): -#> -#> You must have the MazamaSpatialUtils package as well as core datasets installed. -#> -#> Install core datasets with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::installSpatialData() -#> -#> Once installed, initialize spatial data with: -#> -#> MazamaSpatialUtils::setSpatialDataDir("YOUR_DATA_DIR") -#> MazamaSpatialUtils::loadSpatialData("EEZCountries") -#> MazamaSpatialUtils::loadSpatialData("OSMTimezones") -#> MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1") -#> MazamaSpatialUtils::loadSpatialData("USCensusCounties")
    # } +lon <- -120.325278 +lat <- 47.423333 +locationRecord <- location_initialize(lon, lat) +# }
    - @@ -257,7 +228,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/mazama_initialize.html b/docs/reference/mazama_initialize.html index 3b3a6d9..1bafa57 100644 --- a/docs/reference/mazama_initialize.html +++ b/docs/reference/mazama_initialize.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -47,7 +51,6 @@ MazamaSpatialUtils::loadSpatialData("USCensusCounties") " /> - @@ -65,7 +68,7 @@ - +
    @@ -103,7 +106,7 @@
    -
    mazama_initialize(spatialDataDir = "~/Data/Spatial")
    +
    mazama_initialize(spatialDataDir = "~/Data/Spatial")

    Arguments

    @@ -158,28 +161,25 @@

    Value

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Set up directory for spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) - -# Install core spatial datasets (168 MB download) -MazamaSpatialUtils::installSpatialData()
    #> [1] TRUE
    -exists("NaturalEarthAdm1")
    #> [1] FALSE
    mazama_initialize(spatialDataDir) -exists("NaturalEarthAdm1")
    #> [1] TRUE
    class(NaturalEarthAdm1)
    #> [1] "SpatialPolygonsDataFrame" +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) + +exists("NaturalEarthAdm1") +
    #> [1] TRUE
    mazama_initialize(spatialDataDir) +exists("NaturalEarthAdm1") +
    #> [1] TRUE
    class(NaturalEarthAdm1) +
    #> [1] "SpatialPolygonsDataFrame" #> attr(,"package") -#> [1] "sp"
    # } +#> [1] "sp"
    # }
    - @@ -190,7 +190,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/or_monitors_500.html b/docs/reference/or_monitors_500.html index f7d11ba..129f163 100644 --- a/docs/reference/or_monitors_500.html +++ b/docs/reference/or_monitors_500.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -46,16 +50,15 @@ mazama_initialize() setLocationDataDir("./data") -monitor &lt;- monitor_loadLatest() +monitor &lt;- monitor_loadLatest() &lt;!-- %&gt;% monitor_subset(stateCodes = "OR") --&gt; lons &lt;- monitor$meta$longitude lats &lt;- monitor$meta$latitude -table_initialize() - table_addLocation(lons, lats, radius = 500) +table_initialize() &lt;!-- %&gt;% --&gt; + table_addLocation(lons, lats, radius = 500) &lt;!-- %&gt;% --&gt; table_save("or_monitors_500") " /> - @@ -73,7 +76,7 @@ - +
    @@ -111,7 +114,7 @@
    -
    or_monitors_500
    +
    or_monitors_500

    Format

    @@ -168,13 +171,10 @@

    See a

    wa_monitors_500

    - @@ -185,7 +185,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index 64c165d..0a965f4 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    lhs %>% rhs
    +
    lhs %>% rhs
    - @@ -140,7 +142,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/setAPIKey.html b/docs/reference/setAPIKey.html index d26b91a..c3987ca 100644 --- a/docs/reference/setAPIKey.html +++ b/docs/reference/setAPIKey.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    setAPIKey(provider = NULL, key = NULL)
    +
    setAPIKey(provider = NULL, key = NULL)

    Arguments

    @@ -144,14 +147,10 @@

    See a

    getLocationDataDir

    - @@ -162,7 +161,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/setLocationDataDir.html b/docs/reference/setLocationDataDir.html index 40762fd..ca72b2f 100644 --- a/docs/reference/setLocationDataDir.html +++ b/docs/reference/setLocationDataDir.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    setLocationDataDir(dataDir)
    +
    setLocationDataDir(dataDir)

    Arguments

    @@ -142,14 +145,10 @@

    See a

    getLocationDataDir

    - @@ -160,7 +159,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_addColumn.html b/docs/reference/table_addColumn.html index fb40500..a6fe499 100644 --- a/docs/reference/table_addColumn.html +++ b/docs/reference/table_addColumn.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    table_addColumn(
    -  locationTbl = NULL,
    -  columnName = NULL,
    -  locationID = NULL,
    -  locationData = NULL,
    -  verbose = TRUE
    -)
    +
    table_addColumn(
    +  locationTbl = NULL,
    +  columnName = NULL,
    +  locationID = NULL,
    +  locationData = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -166,31 +169,28 @@

    See a

    table_updateColumn

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Starting table -locationTbl <- get(data("wa_monitors_500")) -names(locationTbl)
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" +locationTbl <- get(data("wa_monitors_500")) +names(locationTbl) +
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" #> [6] "countryCode" "stateCode" "county" "timezone" "houseNumber" #> [11] "street" "city" "zip"
    # Add an empty column -locationTbl <- - locationTbl %>% - table_addColumn("siteName") - -names(locationTbl)
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" +locationTbl <- + locationTbl %>% + table_addColumn("siteName") + +names(locationTbl) +
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" #> [6] "countryCode" "stateCode" "county" "timezone" "houseNumber" #> [11] "street" "city" "zip" "siteName"
    - @@ -201,7 +201,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_addLocation.html b/docs/reference/table_addLocation.html index baabdbd..0e534c4 100644 --- a/docs/reference/table_addLocation.html +++ b/docs/reference/table_addLocation.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -40,7 +44,6 @@ against the incoming locationTbl to see if the are already within radius meters of an existing entry. A new record is created for each location that is not already found in locationTbl." /> - @@ -58,7 +61,7 @@ - +
    @@ -96,7 +99,7 @@
    -
    table_addLocation(
    -  locationTbl = NULL,
    -  longitude = NULL,
    -  latitude = NULL,
    -  radius = NULL,
    -  stateDataset = "NaturalEarthAdm1",
    -  elevationService = NULL,
    -  addressService = NULL,
    -  verbose = TRUE
    -)
    +
    table_addLocation(
    +  locationTbl = NULL,
    +  longitude = NULL,
    +  latitude = NULL,
    +  radius = NULL,
    +  stateDataset = "NaturalEarthAdm1",
    +  elevationService = NULL,
    +  addressService = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -191,33 +194,44 @@

    See a

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Set up standard directories and spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -mazama_initialize(spatialDataDir) +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +mazama_initialize(spatialDataDir) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Coulee City, WA -lon <- -119.290904 -lat <- 47.611942 - -locationTbl <- - locationTbl %>% - table_addLocation(lon, lat, radius = 500)
    #> Working on -119.2909040, 47.6119420 ...
    # } -
    +lon<--119.290904 +lat<-47.611942 + +locationTbl<- + locationTbl%>% + table_addLocation(lon, lat, radius =500) +
    #> Working on -119.2909040, 47.6119420 ...
    +dplyr::glimpse(locationTbl) +
    #> Rows: 70 +#> Columns: 13 +#> $ locationID <chr> "8b12e57dee8fc50c", "48ff86b963def74a", "aa4dc983f85e169… +#> $ locationName <chr> "us.wa_8b12e5", "us.wa_48ff86", "us.wa_aa4dc9", "us.wa_8… +#> $ longitude <dbl> -122.6143, -124.6100, -117.9886, -120.5123, -118.3819, -… +#> $ latitude <dbl> 48.52059, 48.36606, 47.88520, 46.59495, 47.12800, 46.318… +#> $ elevation <dbl> 3.73, 1.23, 730.84, 324.28, 549.98, 486.56, 29.01, 4.10,… +#> $ countryCode <chr> "US", "US", "US", "US", "US", "US", "US", "US", "US", "U… +#> $ stateCode <chr> "WA", "WA", "WA", "WA", "WA", "WA", "WA", "WA", "WA", "W… +#> $ county <chr> "Skagit", "Clallam", "Stevens", "Yakima", "Adams", "Colu… +#> $ timezone <chr> "America/Los_Angeles", "America/Los_Angeles", "America/L… +#> $ houseNumber <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … +#> $ street <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … +#> $ city <chr> "Anacortes", "Neah Bay", "Wellpinit", "Yakima", "Ritzvil… +#> $ zip <chr> "96221", "98357", "99040", "98901", "99169", "99328", "9…
    # } +
    - @@ -228,7 +242,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_addSingleLocation.html b/docs/reference/table_addSingleLocation.html index 3720f9b..8165de6 100644 --- a/docs/reference/table_addSingleLocation.html +++ b/docs/reference/table_addSingleLocation.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -40,7 +44,6 @@ against the incoming locationTbl to see if the are already within radius meters of an existing entry. A new record is created for if the location is not already found in locationTbl." /> - @@ -58,7 +61,7 @@ - +
    @@ -96,7 +99,7 @@
    -
    table_addSingleLocation(
    -  locationTbl = NULL,
    -  longitude = NULL,
    -  latitude = NULL,
    -  radius = NULL,
    -  stateDataset = "NaturalEarthAdm1",
    -  elevationService = NULL,
    -  addressService = NULL,
    -  verbose = TRUE
    -)
    +
    table_addSingleLocation(
    +  locationTbl = NULL,
    +  longitude = NULL,
    +  latitude = NULL,
    +  radius = NULL,
    +  stateDataset = "NaturalEarthAdm1",
    +  elevationService = NULL,
    +  addressService = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -188,32 +191,29 @@

    See a

    Examples

    # \donttest{ -library(MazamaLocationUtils) +library(MazamaLocationUtils) # Set up standard directories and spatial data -spatialDataDir <- tempdir() # typically "~/Data/Spatial" -MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) +spatialDataDir <- tempdir() # typically "~/Data/Spatial" +mazama_initialize(spatialDataDir) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Coulee City, WA -lon <- -119.290904 -lat <- 47.611942 +lon <- -119.290904 +lat <- 47.611942 -locationTbl <- - locationTbl %>% - table_addSingleLocation(lon, lat, radius = 500) -# }
    - - + + @@ -224,7 +224,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_export.html b/docs/reference/table_export.html index ca582d4..d4e1e87 100644 --- a/docs/reference/table_export.html +++ b/docs/reference/table_export.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    table_export(locationTbl = NULL, outputType = "csv")
    +
    table_export(locationTbl = NULL, outputType = "csv")

    Arguments

    @@ -140,19 +143,16 @@

    Value

    Representation of a known location table in the desired format.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) -csvString <- table_export(locationTbl)
    +locationTbl <- get(data("wa_monitors_500")) +csvString <- table_export(locationTbl) +
    - @@ -163,7 +163,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_findOverlappingLocations.html b/docs/reference/table_findOverlappingLocations.html index 30db5d2..772f47b 100644 --- a/docs/reference/table_findOverlappingLocations.html +++ b/docs/reference/table_findOverlappingLocations.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -42,7 +46,6 @@ It is useful when working with new metadata tables to identify overlapping locations early on so that decisions can be made about the apporpriateness of the specified radius." /> - @@ -60,7 +63,7 @@ - +
    @@ -98,7 +101,7 @@
    -
    table_findOverlappingLocations(tbl = NULL, radius = NULL)
    +
    table_findOverlappingLocations(tbl = NULL, radius = NULL)

    Arguments

    @@ -150,54 +153,53 @@

    Value

    Tibble of row indices and distances for those locations which overlap.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -meta <- wa_airfire_meta +meta <- wa_airfire_meta # Anything locations closer than 2 km? (diameter = 2*radius) -table_findOverlappingLocations(meta, radius = 1000)
    #> # A tibble: 0 x 3 +table_findOverlappingLocations(meta, radius = 1000) +
    #> # A tibble: 0 x 3 #> # … with 3 variables: row1 <dbl>, row2 <dbl>, distance <dbl>
    # How about 4 km? -table_findOverlappingLocations(meta, radius = 2000)
    #> # A tibble: 3 x 3 +table_findOverlappingLocations(meta, radius = 2000) +
    #> # A tibble: 3 x 3 #> row1 row2 distance #> <int> <int> <dbl> -#> 1 2 34 2500. -#> 2 12 34 3328. +#> 1 2 34 2497. +#> 2 12 34 3329. #> 3 2 9 3762.
    # Let's look at those locations -tooCloseTbl <- table_findOverlappingLocations(meta, radius = 2000) +tooCloseTbl <- table_findOverlappingLocations(meta, radius = 2000) -for ( i in seq_len(nrow(tooCloseTbl)) ) { - rows <- as.numeric(tooCloseTbl[i, 1:2]) - cat(sprintf("\n%5.1f meters apart:\n", tooCloseTbl$distance[i])) - print(meta[rows, c('longitude', 'latitude', 'siteName')]) -}
    #> -#> 2500.2 meters apart: +for ( i in seq_len(nrow(tooCloseTbl)) ) { + rows <- as.numeric(tooCloseTbl[i, 1:2]) + cat(sprintf("\n%5.1f meters apart:\n", tooCloseTbl$distance[i])) + print(meta[rows, c('longitude', 'latitude', 'siteName')]) +} +
    #> +#> 2496.6 meters apart: #> longitude latitude siteName #> 530330057_01 -122.3405 47.56200 Seattle-Duwamish #> 530330080_01 -122.3086 47.56824 Seattle-Beacon Hill #> -#> 3328.1 meters apart: +#> 3329.0 meters apart: #> longitude latitude siteName #> 530330030_01 -122.3197 47.59722 Seattle-10th & Weller #> 530330080_01 -122.3086 47.56824 Seattle-Beacon Hill #> -#> 3761.7 meters apart: +#> 3762.3 meters apart: #> longitude latitude siteName #> 530330057_01 -122.3405 47.5620 Seattle-Duwamish #> 530331011_01 -122.3208 47.5309 Seattle-South Park
    - @@ -208,7 +210,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_getLocationID.html b/docs/reference/table_getLocationID.html index 22a5796..f214f1d 100644 --- a/docs/reference/table_getLocationID.html +++ b/docs/reference/table_getLocationID.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ than one known location exists within the given radius, the closest will be assigned. NA will be returned for each incoming that cannot be assigend to a known location in locationTbl." /> - @@ -59,7 +62,7 @@ - +
    @@ -97,7 +100,7 @@
    -
    table_getLocationID(
    -  locationTbl = NULL,
    -  longitude = NULL,
    -  latitude = NULL,
    -  radius = NULL
    -)
    +
    table_getLocationID(
    +  locationTbl = NULL,
    +  longitude = NULL,
    +  latitude = NULL,
    +  radius = NULL
    +)

    Arguments

    @@ -161,25 +164,23 @@

    Value

    Vector of known locationIDs.

    Examples

    -
    locationTbl <- get(data("wa_monitors_500")) +
    locationTbl <- get(data("wa_monitors_500")) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 +lon <- -120.325278 +lat <- 47.423333 # Too small a radius will not find a match -table_getLocationID(locationTbl, lon, lat, radius = 50)
    #> [1] NA
    +table_getLocationID(locationTbl, lon, lat, radius = 50) +
    #> [1] NA
    # Expanding the radius will find one -table_getLocationID(locationTbl, lon, lat, radius = 5000)
    #> [1] "8e54314f43eb8746"
    +table_getLocationID(locationTbl, lon, lat, radius = 5000) +
    #> [1] "8e54314f43eb8746"
    - @@ -190,7 +191,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_getNearestDistance.html b/docs/reference/table_getNearestDistance.html index 52927db..f44fbb9 100644 --- a/docs/reference/table_getNearestDistance.html +++ b/docs/reference/table_getNearestDistance.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -40,7 +44,6 @@ one for each incoming location. If no known location is found within radius meters for a particular incoming location, that distance in the vector will be NA." /> - @@ -58,7 +61,7 @@ - +
    @@ -96,7 +99,7 @@
    -
    table_getNearestDistance(
    -  locationTbl = NULL,
    -  longitude = NULL,
    -  latitude = NULL,
    -  radius = NULL
    -)
    +
    table_getNearestDistance(
    +  locationTbl = NULL,
    +  longitude = NULL,
    +  latitude = NULL,
    +  radius = NULL
    +)

    Arguments

    @@ -159,27 +162,25 @@

    Value

    Vector of distances from known locations.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 +lon <- -120.325278 +lat <- 47.423333 # Too small a radius will not find a match -table_getNearestDistance(locationTbl, lon, lat, radius = 50)
    #> [1] NA
    +table_getNearestDistance(locationTbl, lon, lat, radius = 50) +
    #> [1] NA
    # Expanding the radius will find one -table_getNearestDistance(locationTbl, lon, lat, radius = 5000)
    #> [1] 1495.593
    +table_getNearestDistance(locationTbl, lon, lat, radius = 5000) +
    #> [1] 1495.593
    - @@ -190,7 +191,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_getNearestLocation.html b/docs/reference/table_getNearestLocation.html index 373eee6..0bed34a 100644 --- a/docs/reference/table_getNearestLocation.html +++ b/docs/reference/table_getNearestLocation.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    table_getNearestLocation(
    -  locationTbl = NULL,
    -  longitude = NULL,
    -  latitude = NULL,
    -  radius = NULL
    -)
    +
    table_getNearestLocation(
    +  locationTbl = NULL,
    +  longitude = NULL,
    +  latitude = NULL,
    +  radius = NULL
    +)

    Arguments

    @@ -157,16 +160,17 @@

    Value

    Tibble of known locations.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 +lon <- -120.325278 +lat <- 47.423333 # Too small a radius will not find a match -table_getNearestLocation(locationTbl, lon, lat, radius = 50) %>% str()
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) +table_getNearestLocation(locationTbl, lon, lat, radius = 50) %>% str() +
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) #> $ locationID : chr NA #> $ locationName: chr NA #> $ longitude : num NA @@ -181,7 +185,8 @@

    Examp #> $ city : chr NA #> $ zip : chr NA

    # Expanding the radius will find one -table_getNearestLocation(locationTbl, lon, lat, radius = 5000) %>% str()
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) +table_getNearestLocation(locationTbl, lon, lat, radius = 5000) %>% str() +
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) #> $ locationID : chr "8e54314f43eb8746" #> $ locationName: chr "us.wa_8e5431" #> $ longitude : num -120 @@ -196,14 +201,10 @@

    Examp #> $ city : chr "Wenatchee" #> $ zip : chr "98801"

    - @@ -214,7 +215,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_getRecordIndex.html b/docs/reference/table_getRecordIndex.html index 400acf9..7557d9b 100644 --- a/docs/reference/table_getRecordIndex.html +++ b/docs/reference/table_getRecordIndex.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    table_getRecordIndex(locationTbl = NULL, locationID = NULL, verbose = TRUE)
    +
    table_getRecordIndex(locationTbl = NULL, locationID = NULL, verbose = TRUE)

    Arguments

    @@ -146,21 +149,22 @@

    Value

    Vector of locationTbl row indexes.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Wenatchee -lon <- -120.325278 -lat <- 47.423333 +lon <- -120.325278 +lat <- 47.423333 # Get the locationID first -locationID <- table_getLocationID(locationTbl, lon, lat, radius = 5000) +locationID <- table_getLocationID(locationTbl, lon, lat, radius = 5000) # Now find the row associated with this ID -recordIndex <- table_getRecordIndex(locationTbl, locationID) +recordIndex <- table_getRecordIndex(locationTbl, locationID) -str(locationTbl[recordIndex,])
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) +str(locationTbl[recordIndex,]) +
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) #> $ locationID : chr "8e54314f43eb8746" #> $ locationName: chr "us.wa_8e5431" #> $ longitude : num -120 @@ -175,14 +179,10 @@

    Examp #> $ city : chr "Wenatchee" #> $ zip : chr "98801"

    - @@ -193,7 +193,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_initialize.html b/docs/reference/table_initialize.html index 28ef265..a788c90 100644 --- a/docs/reference/table_initialize.html +++ b/docs/reference/table_initialize.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -54,7 +58,6 @@ zip " /> - @@ -72,7 +75,7 @@ - +
    @@ -110,7 +113,7 @@
    -
    table_initialize()
    +
    table_initialize()

    Value

    @@ -162,23 +165,21 @@

    Value

    Empty known location tibble with the specified metadata columns.

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Create an empty Tbl -emptyTbl <- table_initialize() -print(emptyTbl)
    #> # A tibble: 0 x 13 +emptyTbl <- table_initialize() +print(emptyTbl) +
    #> # A tibble: 0 x 13 #> # … with 13 variables: locationID <chr>, locationName <chr>, longitude <dbl>, #> # latitude <dbl>, elevation <dbl>, countryCode <chr>, stateCode <chr>, #> # county <chr>, timezone <chr>, houseNumber <chr>, street <chr>, city <chr>, #> # zip <chr>
    - @@ -189,7 +190,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_initializeExisting.html b/docs/reference/table_initializeExisting.html index 029a08b..39a0525 100644 --- a/docs/reference/table_initializeExisting.html +++ b/docs/reference/table_initializeExisting.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -66,7 +70,6 @@ Compared to initializing a brand new table and populating one record at a time, this is a much faster way of creating a known location table from a pre-existing table of metadata." /> - @@ -84,7 +87,7 @@ - +
    @@ -122,7 +125,7 @@
    -
    table_initializeExisting(
    -  tbl = NULL,
    -  stateDataset = "NaturalEarthAdm1",
    -  countryCodes = NULL,
    -  radius = NULL,
    -  verbose = TRUE
    -)
    +
    table_initializeExisting(
    +  tbl = NULL,
    +  stateDataset = "NaturalEarthAdm1",
    +  countryCodes = NULL,
    +  radius = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -227,13 +230,10 @@

    Value

    - @@ -244,7 +244,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_load.html b/docs/reference/table_load.html index 1be8e50..e8cf133 100644 --- a/docs/reference/table_load.html +++ b/docs/reference/table_load.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    table_load(collectionName = NULL)
    +
    table_load(collectionName = NULL)

    Arguments

    @@ -139,32 +142,30 @@

    See a

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Set the directory for saving location tables -setLocationDataDir(tempdir()) +setLocationDataDir(tempdir()) # Load an example table and check the dimensions -locationTbl <- get(data("wa_monitors_500")) -dim(locationTbl)
    #> [1] 69 13
    +locationTbl <- get(data("wa_monitors_500")) +dim(locationTbl) +
    #> [1] 69 13
    # Save it as "table_load_example" -table_save(locationTbl, "table_load_example") +table_save(locationTbl, "table_load_example") # Load it and check the dimensions -my_table <- table_load("table_load_example") -dim(my_table)
    #> [1] 69 13
    +my_table <- table_load("table_load_example") +dim(my_table) +
    #> [1] 69 13
    # Check the locationDataDir -list.files(getLocationDataDir(), pattern = "table_load_example")
    #> [1] "table_load_example.rda"
    +list.files(getLocationDataDir(), pattern = "table_load_example") +
    #> [1] "table_load_example.rda"
    - @@ -175,7 +176,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_removeColumn.html b/docs/reference/table_removeColumn.html index c57f2b0..92e1582 100644 --- a/docs/reference/table_removeColumn.html +++ b/docs/reference/table_removeColumn.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    table_removeColumn(locationTbl = NULL, columnName = NULL, verbose = TRUE)
    +
    table_removeColumn(locationTbl = NULL, columnName = NULL, verbose = TRUE)

    Arguments

    @@ -150,45 +153,44 @@

    See a

    table_removeColumn

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Starting table -locationTbl <- get(data("wa_monitors_500")) -names(locationTbl)
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" +locationTbl <- get(data("wa_monitors_500")) +names(locationTbl) +
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" #> [6] "countryCode" "stateCode" "county" "timezone" "houseNumber" #> [11] "street" "city" "zip"
    # Add a new column -locationTbl <- - locationTbl %>% - table_addColumn("siteName") - -names(locationTbl)
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" +locationTbl <- + locationTbl %>% + table_addColumn("siteName") + +names(locationTbl) +
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" #> [6] "countryCode" "stateCode" "county" "timezone" "houseNumber" #> [11] "street" "city" "zip" "siteName"
    # Now remove it -locationTbl <- - locationTbl %>% - table_removeColumn("siteName") +locationTbl <- + locationTbl %>% + table_removeColumn("siteName") -names(locationTbl)
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" +names(locationTbl) +
    #> [1] "locationID" "locationName" "longitude" "latitude" "elevation" #> [6] "countryCode" "stateCode" "county" "timezone" "houseNumber" #> [11] "street" "city" "zip"
    -if (FALSE) { +if (FALSE) { # Cannot remove "core" metadata -locationTbl <- - locationTbl %>% - table_removeColumn("zip") -}
    +locationTbl <- + locationTbl %>% + table_removeColumn("zip") +} +
    - @@ -199,7 +201,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_removeRecord.html b/docs/reference/table_removeRecord.html index 6880580..da16612 100644 --- a/docs/reference/table_removeRecord.html +++ b/docs/reference/table_removeRecord.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    table_removeRecord(locationTbl = NULL, locationID = NULL, verbose = TRUE)
    +
    table_removeRecord(locationTbl = NULL, locationID = NULL, verbose = TRUE)

    Arguments

    @@ -151,32 +154,30 @@

    See a

    table_updateSingleRecord

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) -dim(locationTbl)
    #> [1] 69 13
    +locationTbl <- get(data("wa_monitors_500")) +dim(locationTbl) +
    #> [1] 69 13
    # Wenatchee -lon <- -120.325278 -lat <- 47.423333 +lon <- -120.325278 +lat <- 47.423333 # Get the locationID first -locationID <- table_getLocationID(locationTbl, lon, lat, radius = 500) +locationID <- table_getLocationID(locationTbl, lon, lat, radius = 500) # Remove it -locationTbl <- table_removeRecord(locationTbl, locationID) -dim(locationTbl)
    #> [1] 69 13
    +locationTbl <- table_removeRecord(locationTbl, locationID) +dim(locationTbl) +
    #> [1] 69 13
    # Test -table_getLocationID(locationTbl, lon, lat, radius = 500)
    #> [1] NA
    +table_getLocationID(locationTbl, lon, lat, radius = 500) +
    #> [1] NA
    - @@ -187,7 +188,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_save.html b/docs/reference/table_save.html index 55ee315..da0df14 100644 --- a/docs/reference/table_save.html +++ b/docs/reference/table_save.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -93,7 +96,7 @@
    -
    table_save(
    -  locationTbl = NULL,
    -  collectionName = NULL,
    -  backup = TRUE,
    -  outputType = "rda"
    -)
    +
    table_save(
    +  locationTbl = NULL,
    +  collectionName = NULL,
    +  backup = TRUE,
    +  outputType = "rda"
    +)

    Arguments

    @@ -157,34 +160,31 @@

    Details

    Backup files are saved with "YYYY-mm-ddTHH:MM:SS"

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) # Set the directory for saving location tables -setLocationDataDir(tempdir()) +setLocationDataDir(tempdir()) # Load an example table and check the dimensions -locationTbl <- get(data("wa_monitors_500")) -dim(locationTbl)
    #> [1] 69 13
    +locationTbl <- get(data("wa_monitors_500")) +dim(locationTbl) +
    #> [1] 69 13
    # Save it as "table_save_example" -table_save(locationTbl, "table_save_example") +table_save(locationTbl, "table_save_example") # Add a column and save again -locationTbl %>% - table_addColumn("my_column") %>% - table_save(locationTbl, "table_save_example") - +locationTbl %>% + table_addColumn("my_column") %>% + table_save(locationTbl, "table_save_example") + # Check the locationDataDir -list.files(getLocationDataDir(), pattern = "table_save_example")
    #> [1] "table_save_example.rda"
    +list.files(getLocationDataDir(), pattern = "table_save_example") +
    #> [1] "table_save_example.rda"
    - @@ -195,7 +195,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_updateColumn.html b/docs/reference/table_updateColumn.html index a9a1592..b6726ad 100644 --- a/docs/reference/table_updateColumn.html +++ b/docs/reference/table_updateColumn.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -94,7 +97,7 @@
    -
    table_updateColumn(
    -  locationTbl = NULL,
    -  columnName = NULL,
    -  locationID = NULL,
    -  locationData = NULL,
    -  verbose = TRUE
    -)
    +
    table_updateColumn(
    +  locationTbl = NULL,
    +  columnName = NULL,
    +  locationID = NULL,
    +  locationData = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -164,24 +167,25 @@

    See a

    table_removeColumn

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) -wa <- get(data("wa_airfire_meta")) +locationTbl <- get(data("wa_monitors_500")) +wa <- get(data("wa_airfire_meta")) # We will merge some metadata from wa into locationTbl # Record indices for wa -wa_indices <- seq(5,65,5) -wa_sub <- wa[wa_indices,] +wa_indices <- seq(5,65,5) +wa_sub <- wa[wa_indices,] -locationID <- table_getLocationID(locationTbl, wa_sub$longitude, wa_sub$latitude, radius = 500) -locationData <- wa_sub$siteName +locationID <- table_getLocationID(locationTbl, wa_sub$longitude, wa_sub$latitude, radius = 500) +locationData <- wa_sub$siteName -locationTbl <- table_updateColumn(locationTbl, "siteName", locationID, locationData) +locationTbl <- table_updateColumn(locationTbl, "siteName", locationID, locationData) # Look at the data we attempted to merge -wa$siteName[wa_indices]
    #> [1] "Chelan-Woodin Ave" "Lacrosse-Hill St" +wa$siteName[wa_indices] +
    #> [1] "Chelan-Woodin Ave" "Lacrosse-Hill St" #> [3] "Kennewick-Metaline" "Sunnyside-S 16th" #> [5] "Inchelium" "Wellpinit-Spokane Tribe" #> [7] "Lake Forest Park-Town Center" "Twisp-Glover St" @@ -189,8 +193,9 @@

    Examp #> [11] "Ritzville-Alder St " "Darrington-Fir St" #> [13] "Tukwila_Allentown"

    # And two columns from the updated locationTbl -locationTbl_indices <- table_getRecordIndex(locationTbl, locationID) -locationTbl[locationTbl_indices, c("city","siteName")]
    #> # A tibble: 13 x 2 +locationTbl_indices <- table_getRecordIndex(locationTbl, locationID) +locationTbl[locationTbl_indices, c("city","siteName")] +
    #> # A tibble: 13 x 2 #> city siteName #> <chr> <chr> #> 1 Chelan "Chelan-Woodin Ave" @@ -208,15 +213,10 @@

    Examp #> 13 Tukwila "Tukwila_Allentown"

    - @@ -227,7 +227,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/table_updateSingleRecord.html b/docs/reference/table_updateSingleRecord.html index 6d360a0..24ffdeb 100644 --- a/docs/reference/table_updateSingleRecord.html +++ b/docs/reference/table_updateSingleRecord.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ for small tweaks to an existing locationTbl. Wholesale replacement of records should be performed with table_removeRecord() followed by table_addLocation()." /> - @@ -59,7 +62,7 @@ - +
    @@ -97,7 +100,7 @@
    -
    table_updateSingleRecord(
    -  locationTbl = NULL,
    -  locationList = NULL,
    -  verbose = TRUE
    -)
    +
    table_updateSingleRecord(
    +  locationTbl = NULL,
    +  locationList = NULL,
    +  verbose = TRUE
    +)

    Arguments

    @@ -162,16 +165,17 @@

    See a

    table_removeRecord

    Examples

    -
    library(MazamaLocationUtils) +
    library(MazamaLocationUtils) -locationTbl <- get(data("wa_monitors_500")) +locationTbl <- get(data("wa_monitors_500")) # Wenatchee -wenatcheeRecord <- - locationTbl %>% - dplyr::filter(city == "Wenatchee") +wenatcheeRecord <- + locationTbl %>% + dplyr::filter(city == "Wenatchee") -str(wenatcheeRecord)
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) +str(wenatcheeRecord) +
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) #> $ locationID : chr "8e54314f43eb8746" #> $ locationName: chr "us.wa_8e5431" #> $ longitude : num -120 @@ -185,20 +189,21 @@

    Examp #> $ street : chr NA #> $ city : chr "Wenatchee" #> $ zip : chr "98801"

    -wenatcheeID <- wenatcheeRecord$locationID +wenatcheeID <- wenatcheeRecord$locationID -locationTbl <- table_updateSingleRecord( - locationTbl, - locationList = list( - locationID = wenatcheeID, - locationName = "Wenatchee-Fifth St" - ) -) +locationTbl <- table_updateSingleRecord( + locationTbl, + locationList = list( + locationID = wenatcheeID, + locationName = "Wenatchee-Fifth St" + ) +) # Look at the new record -locationTbl %>% - dplyr::filter(city == "Wenatchee") %>% - str()
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) +locationTbl %>% + dplyr::filter(city == "Wenatchee") %>% + str() +
    #> tibble [1 × 13] (S3: tbl_df/tbl/data.frame) #> $ locationID : chr "8e54314f43eb8746" #> $ locationName: chr "Wenatchee-Fifth St" #> $ longitude : num -120 @@ -214,15 +219,10 @@

    Examp #> $ zip : chr "98801"

    - @@ -233,7 +233,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/validateLonLat.html b/docs/reference/validateLonLat.html index 2e97803..f054355 100644 --- a/docs/reference/validateLonLat.html +++ b/docs/reference/validateLonLat.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    validateLonLat(longitude = NULL, latitude = NULL)
    +
    validateLonLat(longitude = NULL, latitude = NULL)

    Arguments

    @@ -144,13 +147,10 @@

    Value

    Invisibly returns TRUE if no error message has been generated.

    - @@ -161,7 +161,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/validateLonsLats.html b/docs/reference/validateLonsLats.html index b03cc5b..e3e1546 100644 --- a/docs/reference/validateLonsLats.html +++ b/docs/reference/validateLonsLats.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    validateLonsLats(longitude = NULL, latitude = NULL)
    +
    validateLonsLats(longitude = NULL, latitude = NULL)

    Arguments

    @@ -144,13 +147,10 @@

    Value

    Invisibly returns TRUE if no error message has been generated.

    - @@ -161,7 +161,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/validateMazamaSpatialUtils.html b/docs/reference/validateMazamaSpatialUtils.html index 7f7efc6..4d36f60 100644 --- a/docs/reference/validateMazamaSpatialUtils.html +++ b/docs/reference/validateMazamaSpatialUtils.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
    @@ -95,7 +98,7 @@
    -
    validateMazamaSpatialUtils()
    +
    validateMazamaSpatialUtils()

    Value

    @@ -132,12 +135,10 @@

    Value

    Invisibly returns TRUE if no error message has been generated.

    - @@ -148,7 +149,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/wa_airfire_meta.html b/docs/reference/wa_airfire_meta.html index 1044574..5a8d6f7 100644 --- a/docs/reference/wa_airfire_meta.html +++ b/docs/reference/wa_airfire_meta.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -43,14 +47,13 @@ library(PWFSLSmoke) wa_airfire_meta &lt;- - monitor_loadLatest() - monitor_subset(stateCodes = "WA") + monitor_loadLatest() &lt;!-- %&gt;% --&gt; + monitor_subset(stateCodes = "WA") &lt;!-- %&gt;% --&gt; monitor_extractMeta() save(wa_airfire_meta, file = "data/wa_airfire_meta.rda") " /> - @@ -68,7 +71,7 @@ - +
    @@ -106,7 +109,7 @@
    -
    wa_airfire_meta
    +
    wa_airfire_meta

    Format

    @@ -154,12 +157,10 @@

    FormatA tibble with 69 rows and 19 columns of data.

    - @@ -170,7 +171,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/wa_monitors_500.html b/docs/reference/wa_monitors_500.html index 7f4a82a..e72b376 100644 --- a/docs/reference/wa_monitors_500.html +++ b/docs/reference/wa_monitors_500.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -46,16 +50,15 @@ mazama_initialize() setLocationDataDir("./data") -monitor &lt;- monitor_loadLatest() +monitor &lt;- monitor_loadLatest() &lt;!-- %&gt;% monitor_subset(stateCodes = "WA") --&gt; lons &lt;- monitor$meta$longitude lats &lt;- monitor$meta$latitude -table_initialize() - table_addLocation(lons, lats, radius = 500) +table_initialize() &lt;!-- %&gt;% --&gt; + table_addLocation(lons, lats, radius = 500) &lt;!-- %&gt;% --&gt; table_save("wa_monitors_500") " /> - @@ -73,7 +76,7 @@ - +
    @@ -111,7 +114,7 @@
    -
    wa_monitors_500
    +
    wa_monitors_500

    Format

    @@ -168,13 +171,10 @@

    See a

    or_monitors_500

    - @@ -185,7 +185,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/man/location_getSingleAddress_Photon.Rd b/man/location_getSingleAddress_Photon.Rd index cf1f402..473b0c2 100644 --- a/man/location_getSingleAddress_Photon.Rd +++ b/man/location_getSingleAddress_Photon.Rd @@ -27,6 +27,7 @@ List of address components. The Photon API is used get address data associated with the \code{longitude} and \code{latitude}. The following list of data is returned: + \itemize{ \item{\code{houseNumber}} \item{\code{street}} @@ -37,6 +38,7 @@ is returned: \item{\code{countryCode}} \item{\code{countryName}} } + The function makes an effort to convert both \code{state} and \code{country} \code{Name} into \code{Code} with codes defaulting to \code{NA}. Both \code{Name} and \code{Code} are returned so that improvements can be made in @@ -56,7 +58,8 @@ lat <- 47.423333 addressList <- location_getSingleAddress_Photon(lon, lat) str(addressList) } + } \references{ -\url{http://photon.komoot.de} +\url{http://photon.komoot.io} } diff --git a/man/location_getSingleAddress_TexasAM.Rd b/man/location_getSingleAddress_TexasAM.Rd index 6e03f77..a1f01c4 100644 --- a/man/location_getSingleAddress_TexasAM.Rd +++ b/man/location_getSingleAddress_TexasAM.Rd @@ -29,7 +29,7 @@ Texas A&M APIs are used to determine the address associated with the \code{longitude} and \code{latitude}. } \examples{ -\donttest{ +\dontrun{ library(MazamaLocationUtils) # Set up standard directories and spatial data @@ -43,6 +43,7 @@ apiKey <- YOUR_PERSONAL_API_KEY location_getSingleAddress_TexasAM(longitude, latitude, apiKey) } + } \references{ \url{https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP.aspx} diff --git a/man/location_getSingleElevation_USGS.Rd b/man/location_getSingleElevation_USGS.Rd index 972edad..a16c06a 100644 --- a/man/location_getSingleElevation_USGS.Rd +++ b/man/location_getSingleElevation_USGS.Rd @@ -33,6 +33,7 @@ lon <- -120.325278 lat <- 47.423333 location_getSingleElevation_USGS(lon, lat) } + } \references{ \url{https://nationalmap.gov/epqs/} diff --git a/man/mazama_initialize.Rd b/man/mazama_initialize.Rd index 3613f8b..ec07a58 100644 --- a/man/mazama_initialize.Rd +++ b/man/mazama_initialize.Rd @@ -34,9 +34,6 @@ library(MazamaLocationUtils) spatialDataDir <- tempdir() # typically "~/Data/Spatial" MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) -# Install core spatial datasets (168 MB download) -MazamaSpatialUtils::installSpatialData() - exists("NaturalEarthAdm1") mazama_initialize(spatialDataDir) exists("NaturalEarthAdm1") diff --git a/man/table_addLocation.Rd b/man/table_addLocation.Rd index 45fb5bb..85a2035 100644 --- a/man/table_addLocation.Rd +++ b/man/table_addLocation.Rd @@ -64,6 +64,8 @@ lat <- 47.611942 locationTbl <- locationTbl \%>\% table_addLocation(lon, lat, radius = 500) + +dplyr::glimpse(locationTbl) } } \seealso{ diff --git a/man/table_addSingleLocation.Rd b/man/table_addSingleLocation.Rd index a87104a..2f188b7 100644 --- a/man/table_addSingleLocation.Rd +++ b/man/table_addSingleLocation.Rd @@ -50,7 +50,7 @@ library(MazamaLocationUtils) # Set up standard directories and spatial data spatialDataDir <- tempdir() # typically "~/Data/Spatial" -MazamaSpatialUtils::setSpatialDataDir(spatialDataDir) +mazama_initialize(spatialDataDir) locationTbl <- get(data("wa_monitors_500")) diff --git a/tests/testthat/test-table_findOverlappingLocations.R b/tests/testthat/test-table_findOverlappingLocations.R index 8d7cd4d..1e8946c 100644 --- a/tests/testthat/test-table_findOverlappingLocations.R +++ b/tests/testthat/test-table_findOverlappingLocations.R @@ -46,8 +46,9 @@ test_that("passing radius = 2000 returns expected output", { expect_equal(class(result), c("tbl_df", "tbl", "data.frame")) # Is it the expected tibble? - correctTbl <- dplyr::tibble(row1 = c(2, 12, 2), row2 = c(34, 34, 9), distance = c(2500, 3328, 3762)) + correctTbl <- dplyr::tibble(row1 = c(2, 12, 2), row2 = c(34, 34, 9), distance = c(2497, 3329, 3762)) expect_equal(result$row1, correctTbl$row1) expect_equal(result$row2, correctTbl$row2) expect_equal(round(result$distance, 0), correctTbl$distance) + }) \ No newline at end of file