newLandscapeDim: Resample a raster brick into a new resolution

View source: R/def_grid2.R

newLandscapeDimR Documentation

Resample a raster brick into a new resolution

Description

resample the landscape to new dimensions given by continuous scaling number fac

Usage

newLandscapeDim(rs, fac = 1)

Arguments

rs

a raster brick object to resample

fac

is a number that is multiplied times the number of cols to calculate new dims

Details

Takes a raster brick and resamples into a new resolution more coarse than the current raster brick resolution. fac is a factor on the interval 0-1 that determines how many cells in the new raster brick, relative to the original raster brick. For example, fac = 0.5 would take the number of cells in each dimension in the original raster brick and reduce the same extent into 50

Value

Raster brick with resolution specified by the combination of the input landscape (rs) and the rescaling parameter (fac)

See Also

ashSetupLandscape, def_grid_pred2, getpophist2.cells

Examples

library(holoSimCell)
rs <- raster::brick(system.file("extdata/rasters/ccsm_160kmExtent_maxent.tif", package = "holoSimCell"))
newrs <- newLandscapeDim(rs,0.45)
land <- def_grid_pred2(pred=newrs, samps=transSampLoc(pts, range.epsg=4326, raster.proj=crs(rs)@projargs), raster.proj=crs(rs)@projargs)


stranda/holoSimCell documentation built on Aug. 4, 2023, 1:12 p.m.