Learn R Programming

rasterList (version 0.5.20)

crop,RasterList-method: Crop methods for a RasterList-class object.

Description

Crop methods for a RasterList-class object.

Usage

# S4 method for RasterList
crop(x, y, check.RasterList = TRUE, ...)

Value

a "cropped" RasterList-class object

Arguments

x

a valid object

y

a Spatial Object or an Extent

check.RasterList

logical value. If it is TRUE, it checks the x RasterList-class object. Default is FALSE.

...

further arguments

Examples

Run this code


precf <- system.file("map/Mekrou_precipitation.grd", package="rasterList")
prec <- stack(precf)
# \donttest{
## Sample L-moments 
if (requireNamespace("lmom",quietly = TRUE)) {
library(lmom)

samlmom <- stack(rasterList(prec,FUN=samlmu))
## Fitting a Random Probability Distribution: it is a 'rasterList' Object
fitdist <- rasterList(samlmom,FUN=pelgam)

##### ZOOM IN 
## set a mask 
mask <-raster( extent(fitdist)/4 )


fitdist_masked <- crop ( x = fitdist,y=mask)
}
# }




Run the code above in your browser using DataLab