R/mazama_initialize.R
mazama_initialize.Rd
Convenience function to initialize spatial data for US state and county maps. Wraps the following setup lines:
MazamaSpatialUtils::setSpatialDataDir(spatialDataDir)
MazamaSpatialUtils::loadSpatialData("USCensusCounties_02")
MazamaSpatialUtils::loadSpatialData("USCensusStates_02")
mazama_initialize(spatialDataDir = "~/Data/Spatial")
Directory where spatial datasets are found, Default: "~/Data/Spatial"
No return value.
# \donttest{
library(MazamaSpatialPlots)
# Set up directory for spatial data
spatialDataDir <- tempdir() # typically "~/Data/Spatial"
MazamaSpatialUtils::setSpatialDataDir(spatialDataDir)
exists("USCensusStates_02")
#> [1] TRUE
mazama_initialize(spatialDataDir)
exists("USCensusStates_02")
#> [1] TRUE
class(USCensusStates_02)
#> [1] "sf" "data.frame"
# }