Raster object or matrix, an empty landscape raster or a mask indicating where the patch cannot be generated (see bgr below).
class
(or patch),
size
integer. Size of expansion, as number of raster cells.
bgr
integer. The background available where expansion is allowed (i.e. shrinking classes).
pts
integer, the seed point locations around which the patches are built (random points are given by default)
Value
A RasterLayer object. If rast=FALSE returns a list of vectors, each containing the context cells assigned to each patch.
Examples
require(raster)
m = matrix(0, 33, 33)
r = raster(m, xmn=0, xmx=10, ymn=0, ymx=10)
r = makeClass(r, 5, 10)
plot(r)
rr = expandClass(r, 1, 100)
plot(rr)
## This function can be used to mimic shapes, by providing a skeleton:
m[,17] = 1
r = raster(m, xmn=0, xmx=10, ymn=0, ymx=10)
plot(r)
rr = expandClass(r, 1, 100)
plot(rr)