library(geodata)
options(timeout = 600)
# Climate
clim <- worldclim_global(var = "bio", res = 2.5, path = tempdir())
clim <- subset(clim, c(1, 5, 6, 12, 14, 15))
names(clim) <- paste0("BIO", c(1, 5, 6, 12, 14, 15))
# Elevation
dem <- elevation_global(res = 2.5, path = tempdir())
names(dem) <- "elevation"
# soil layers
soil_vars <- c(
soil_world("phh2o", depth = 5, path = tempdir()),
soil_world("soc", depth = 5, path = tempdir()),
soil_world("sand", depth = 5, path = tempdir()),
soil_world("clay", depth = 5, path = tempdir()))
names(soil_vars) <- c("phh2o", "soc", "sand", "clay")
# Human footprint
hfp <- footprint(path = tempdir())
names(hfp) <- "human_footprint"
# Put together, can we directly put them together?
vars <- c(clim, dem, resample(soil_vars, clim), resample(hfp, clim))