Learn R Programming

berryFunctions (version 1.10.0)

rcor: Spatially correlated random values

Description

Generate random values, but with spatial correlation

Usage

rcor(n, xmin, xmax, ymin, ymax, allplots = TRUE, zstart, zfun = rnorm, ...)

Arguments

n
Number of randomly scattered points to be created
xmin
Smallest x-coordinate
xmax
Largest x-coordinate
ymin
Smallest y-coordinate
ymax
Largest y-coordinate
allplots
Save all plots in dummy.pdf? DEFAULT: TRUE
zstart
Vector of starting values for seeding some points, must be shorter than n
zfun
A function for random noise creation, taking n as first argument. DEFAULT: rnorm
...
Further arguments passed to zfun, like sd=3

References

For regular grid fields, see: http://santiago.begueria.es/2010/10/generating-spatially-correlated-random-fields-with-r/

Examples

Run this code
# ToDO: expand function + write examples

Run the code above in your browser using DataLab