mazama_initialize: Initialize with MazamaScience standard directories

View source: R/mazama_initialize.R

mazama_initializeR Documentation

Initialize with MazamaScience standard directories

Description

Convenience function to initialize spatial data. Wraps the following setup lines:

MazamaSpatialUtils::setSpatialDataDir(spatialDataDir)

MazamaSpatialUtils::loadSpatialData("EEZCountries.rda")
MazamaSpatialUtils::loadSpatialData("OSMTimezones.rda")
MazamaSpatialUtils::loadSpatialData("NaturalEarthAdm1.rda")
MazamaSpatialUtils::loadSpatialData("USCensusCounties.rda")

Usage

mazama_initialize(spatialDataDir = "~/Data/Spatial")

Arguments

spatialDataDir

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

Value

No return value.

Examples


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")
  mazama_initialize(spatialDataDir)
  exists("NaturalEarthAdm1")
  class(NaturalEarthAdm1)
  
}, silent = FALSE)


MazamaLocationUtils documentation built on March 18, 2022, 7:24 p.m.