multi_extract: Gets values from multiple rasters.

View source: R/multi_extract.R

multi_extractR Documentation

Gets values from multiple rasters.

Description

multi_extract Extract values of multiple spatial rasters for a set of geographical coordinates.

Usage

multi_extract(
  raster_path,
  coord,
  folders = NULL,
  files = NULL,
  layers = NULL,
  ncores = 1
)

Arguments

raster_path

character. Path to the folder with raster folders.

coord

data.frame or matrix. Longitude and Latitude from where to extract raster values.

folders

character. folders from which to get rasters for extraction. If NULL, all folders are selected.

files

numeric. Index for raster files to be extracted from each folder. If NULL, all files are selected.

layers

numeric. Index for layers to be extracted from each raster file. If NULL, all layers are selected.

ncores

integer. Number of cores to use in parallel processing.

Value

Data frame with extracted values from multiple rasters

Examples


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

temp_pres <-
  multi_extract(raster_path = "mydir/rasters/worldclim/global_rasters_10min/",
                coord = TtorquatusDistribution[-1],
                folders = c("tmax_present", "tmin_present"))
                
## End(Not run)


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