rmarks_ppp | R Documentation |
marks
Generation Function for ppp.objectCreate random marks
generation function for ppp.object.
rmarks_ppp(f)
f |
function of random number generation, e.g., rlnorm, rnbinom, etc. Can also be the function name as a character scalar. |
Function rmarks_ppp()
returns a function,
which generates random marks of a ppp.object
following the probability distribution specified by argument f
.
The returned function
has first parameter x
taking an argument of a ppp.object.
returns a ppp.object.
rmarks_ppp(rlnorm)
rmarks_ppp('rnbinom')
plot(pp <- rpoispp(lambda = 100))
plot(pp |>
rmarks_ppp(rlnorm)(sdlog = .5) |>
rmarks_ppp(rnbinom)(size = 5L, prob = .3) |>
rmarks_ppp(rfactor)(prob = c(2,1,3), levels = letters[1:3]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.