Description Usage Arguments Details Value Author(s) See Also Examples
A function to cut a raster based on an informed shapefile.
1 2 | cut.raster(abio, shape.dir, extension = ".asc", br = FALSE, plot = TRUE,
diretorio = "cortados", trim = FALSE)
|
abio |
an object with the rasters to be cut. Accepts an object of type RasterStack, generated by the function |
shape.dir |
here are two options. The first is to inform an object in the shapefile format. The second option is to inform a directory containing the shapefile. |
extension |
extent of the cut rasters. Default is .asc, see |
br |
logical. If TRUE, use the Brazil shape provided by |
plot |
logical. Plots one of the cut rasters. |
trim |
logical. If TRUE, exclude pixels with NA (very slow). If FALSE (default), keep the NAs. |
When the shapeir argument is a folder where it contains the reference shape, this folder must contain only the shape and its auxiliary files.
Raster files in a folder "Cortados".
Diogo S. B. Rocha
1 2 3 | fnames <- list.files(path=paste(system.file(package="dismo"), '/ex', sep=''), pattern='grd', full.names=TRUE )
predictors <- raster::stack(fnames)
cut.raster(abio = predictors, br=T, extension = ".tif")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.