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")

Arguments

spatialDataDir

Directory where spatial datasets are found, Default: "~/Data/Spatial"

Value

No return value.

Examples

# \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"
# }