get_rasters: Retrieve and organize spatial rasters.

View source: R/get_rasters.R

get_rastersR Documentation

Retrieve and organize spatial rasters.

Description

get_rasters Loads rasters from directory and returns them in an organized list of specified scenarios.

Usage

get_rasters(
  var = NULL,
  scenario = NULL,
  raster_path = NULL,
  ext = c(-180, 180, -60, 90),
  coord_col = c("Lon", "Lat"),
  margin = 0,
  separator = "_"
)

Arguments

var

character. Names of variables to be loaded.

scenario

character. Names of scenarios for the variables.

raster_path

character. Path to folder with raster files. See writeFormats for supported formats

ext

numeric, data. frame or Extent object. Extent to crop rasters.

coord_col

character. Names of columns containing Longitude and Latitude.

margin

numeric. Additional distance to be added to margin of extent, in degrees.

separator

character. Character that separates variable names and scenario names.

Value

Returns a list of raster stacks for the variables required, organized by year/scenario combination.

Examples

## Not run: 
# replace rasterpath with the directory on your computer containing worldclim data

Fulanus_Ecorasters_present <-
  get_rasters(
    var = c('prec', 'tmin', 'tmax'),
    scenario = 'present',
    raster_path = "C:/Users/gabri/Dropbox/Mapinguari/global_grids_10_minutes",
    ext = FulanusDistribution[c(2,3)],
    margin = 5)

## End(Not run)

gabrielhoc/Mapinguari documentation built on July 6, 2023, 6:40 p.m.