cropResampleTrim: Line two rasters or stacks or lists of rasters

View source: R/spatialUtils.R

cropResampleTrimR Documentation

Line two rasters or stacks or lists of rasters

Description

Obtain the same extents and resample to the finest resolution layer.

Usage

cropResampleTrim(expertMap, maskListRaw)

Arguments

expertMap

A binary map, either as a polygon or a raster.

maskListRaw

A list of rasters, each corresponding to layers from which masks will eventually be made (in another function).

Details

See Examples.

Value

a list

Author(s)

Cory Merow <cory.merow@gmail.com>,

Examples

r1 <- raster::raster(raster::extent(c(-72, -64, 41, 50)), res = c(0.008333333, 0.008333333))
raster::values(r1) <- (1:raster::ncell(r1))^2
coords <- dismo::randomPoints(r1, 4)
polyg <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(coords)),1)))
r2 <- raster::raster(raster::extent(c(-72, -64, 41, 50)), res = c(0.008333333, 0.008333333))
raster::values(r2) <- (1:raster::ncell(r2))^3
r3 <- raster::raster(raster::extent(c(-72, -64, 41, 50)), res = c(0.008333333, 0.008333333))
raster::values(r3) <- (1:raster::ncell(r3))^0.5
maskListRaw <- list(r1, r2, r3)
cropResampleTrim(expertMap = polyg, maskListRaw = maskListRaw)


maskRangeR documentation built on May 11, 2022, 5:07 p.m.