Method to load rasters from disk or from the internet. By default a RasterStack is returned but this is only possible When all rasters have the same spatial extent and resolution.
Arguments
- layercodes
character vector or dataframe. Layer_codes of the layers to be loaded or dataframe with a "layer_code" column.
- equalarea
logical. If
TRUE
then layers are loaded with a Behrmann cylindrical equal-area projection (equalareaproj
), otherwise unprojected (lonlatproj
). Default isFALSE
.- rasterstack
logical. If
TRUE
(default value) then the result is astack
otherwise a list of rasters is returned.- datadir
character. Directory where you want to store the data. If
NULL
is passed (default) then thesdmpredictors_datadir
option is read. To set this runoptions(sdmpredictors_datadir="<your preferred directory>")
in every session or add it to your .RProfile.
Examples
if (FALSE) {
# warning using tempdir() implies that data will be downloaded again in the
# next R session
env <- load_layers("BO_calcite", datadir = tempdir())
}