cut.raster: Cut raster based on a shape

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A function to cut a raster based on an informed shapefile.

Usage

1
2
cut.raster(abio, shape.dir, extension = ".asc", br = FALSE, plot = TRUE,
  diretorio = "cortados", trim = FALSE)

Arguments

abio

an object with the rasters to be cut. Accepts an object of type RasterStack, generated by the function stack

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, seewrite.raster for more output format possibilities.

br

logical. If TRUE, use the Brazil shape provided by wrld_simpl. If FALSE (default), use the informed shape.

plot

logical. Plots one of the cut rasters.

trim

logical. If TRUE, exclude pixels with NA (very slow). If FALSE (default), keep the NAs.

Details

When the shapeir argument is a folder where it contains the reference shape, this folder must contain only the shape and its auxiliary files.

Value

Raster files in a folder "Cortados".

Author(s)

Diogo S. B. Rocha

See Also

crop, mask, stack

Examples

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")

diogosbr/modelos documentation built on May 9, 2019, 5:23 p.m.