genesis | R Documentation |
This function generates a raster stack in which each layer represents a variable. Each variable can have one of several spatial patterns: linear, uniform, random, step, hinge, Gaussian, or sine. Random noise can also be added to any one of these patterns, and the layer pattern can be split in half (e.g., increasing in the "east" side and decreasing in the "west" side). The landscape can be circular or square. Layers can be rotated around their center to have different orientations relative to other rasters.
genesis(geography, size = 1024, circle = TRUE, verbose = FALSE, ...)
geography |
List object composed of lists, with one list per layer on the landscape. The name of the sublists correspond to the names of the layers to be generated. Each sublist has some of the following components (some are required, some optional).
|
size |
Positive integer, number of rows/columns in each landscape raster. |
circle |
Logical, if |
verbose |
Logical, if |
... |
Other arguments (unused). |
A raster stack.
geog1 <- list( uniform=list(type='uniform'), random=list(type='random', min=-1, max=1), linear=list(type='linear', min=-1, max=1), linearNoise=list(type='linear', min=-1, max=1, noise=0.3), step=list(type='step', min=-1, max=1, at=0.5), hinge=list(type='hinge', min=-1, max=1, from=-0.5, to=0), gauss=list(type='gaussian', center1=0, center2=0.25, sd1=0.5, sd2=0.25, rho=2/3), sine=list(type='sin', freq=2, offset=0, min=-1, max=1) ) # square landscape land <- genesis(geography=geog1, size=201, circle=FALSE) raster::plot(land) # circular landscape land <- genesis(geography=geog1, size=201) raster::plot(land) # layer rotation geog2 <- list( x1=list(type='linear', min=-1, max=1), x2=list(type='linear', min=-1, max=1, rot=45) ) land <- genesis(geog2, size=201, circle=TRUE) raster::plot(land) # fancy stuff set.seed(123) geog3 <- list( control=list(type='linear', min=-1, max=1), noisy=list(type='linear', min=-1, max=1, noisy=TRUE), split=list(type='linear', min=-1, max=1, split=TRUE), randOrient=list(type='linear', min=-1, max=1, randOrient=TRUE), all=list(type='linear', min=-1, max=1, noisy=TRUE, split=TRUE, randOrient=TRUE) ) land <- genesis(geog3, size=201) raster::plot(land)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.