rMosaicField {spatstat.random} | R Documentation |
Mosaic Random Field
Description
Generate a realisation of a random field which is piecewise constant on the tiles of a given tessellation.
Usage
rMosaicField(X,
rgen = function(n) { sample(0:1, n, replace = TRUE)},
...,
rgenargs=NULL)
Arguments
X |
A tessellation (object of class |
... |
Arguments passed to |
rgen |
Function that generates random values for the tiles of the tessellation. |
rgenargs |
List containing extra arguments that should be passed
to |
Details
This function generates a realisation of a random field
which is piecewise constant on the tiles of the given
tessellation X
. The values in each tile
are independent and identically distributed.
Value
A pixel image (object of class "im"
).
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Rolf Turner rolfturner@posteo.net
See Also
Examples
if(interactive()) {
lambda <- 3
d <- 256
n <- 30
} else {
lambda <- 1
d <- 32
n <- 5
}
X <- rpoislinetess(lambda)
plot(rMosaicField(X, runif, dimyx=d))
plot(rMosaicField(X, rnorm, rgenargs=list(mean=10, sd=2), dimyx=d))
Y <- dirichlet(runifpoint(n))
plot(rMosaicField(Y, rnorm, dimyx=d))
[Package spatstat.random version 3.3-1 Index]