View source: R/initializeMazamaSpatialUtils.R
initializeMazamaSpatialUtils | R Documentation |
Convenience function that wraps:
MazamaSpatialUtils::setSpatialDataDir("~/Data/Spatial") MazamaSpatialUtils::loadSpatialData("EEZCountries.rda") . MazamaSpatialUtils::loadSpatialData("OSMTimezones.rda") MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1.rda") MazamaSpatialUtils::loadSpatialData("USCensusCounties.rda")
If spatial data has not yet been installed, an error is returned with an extended message detailing how to install the appropriate data.
initializeMazamaSpatialUtils(spatialDataDir = "~/Data/Spatial")
spatialDataDir |
Directory where MazamaSpatialUtils datasets are found. |
library(MazamaLocationUtils)
# Fail gracefully if any resources are not available
try({
# Set up directory for spatial data
spatialDataDir <- tempdir() # typically "~/Data/Spatial"
MazamaSpatialUtils::setSpatialDataDir(spatialDataDir)
exists("NaturalEarthAdm1")
initializeMazamaSpatialUtils(spatialDataDir)
exists("NaturalEarthAdm1")
class(NaturalEarthAdm1)
}, silent = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.