| Type: | Package |
| Title: | Simulated Point-Pattern via Vectorized Parameterization |
| Version: | 0.3.0 |
| Date: | 2026-05-14 |
| Description: | An intuitive interface to simulate superimposed (marked) point patterns with vectorized parameterization of random point pattern and distribution of marks. |
| Encoding: | UTF-8 |
| License: | GPL-2 |
| Language: | en-US |
| URL: | https://github.com/tingtingzhan/rppp |
| Depends: | R (≥ 4.6) |
| Imports: | cli, spatstat.geom, spatstat.random |
| Config/roxygen2/version: | 8.0.0 |
| Config/roxygen2/markdown: | TRUE |
| NeedsCompilation: | no |
| Packaged: | 2026-05-15 03:57:37 UTC; tingtingzhan |
| Author: | Tingting Zhan |
| Maintainer: | Tingting Zhan <tingtingzhan@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-19 09:20:50 UTC |
Superimposed (Marked) Point Pattern
Description
To simulate superimposed ppp.object(s), with none or one or multiple marks.
Usage
.rppp(..., win = square(), n = 1L, unlist1 = TRUE, envir = parent.frame())
Arguments
... |
one or more calls.
The first call specifies the parameters to
generate the |
win |
|
n |
integer scalar,
number of ppp.objects to generate.
Default |
unlist1 |
logical scalar, whether to return
a ppp.object,
instead of a length- |
envir |
environment, in which to evaluate the |
Value
The function .rppp() returns a ppp.object if (n==1L)&unlist1,
otherwise returns a length-n solist
(which also has class 'ppplist').
The returned ppp.object(s) contain only
x- and y-coords,
if only one call is present in the ... dyn-dots argument.
Otherwise, they contain one or more marks
according to the rest of the call(s) in the ... argument.
Note
The function name rppp() is too aggressive, which might be claimed in future by package spatstat.random.
Therefore we name this function .rppp() as if it is hidden (see parameter all.names of the function ls).
Generate Random factor
Description
To generate random factor.
Usage
rfactor(n, prob, levels = names(prob) %||% as.character(seq_len(nprob)))
Arguments
n |
integer scalar |
prob |
numeric vector, see function sample.int |
levels |
Details
The function rfactor() is a wrapper of sample.int.
Value
The function rfactor() returns a factor.
Note
The function rmultinom is not what we need!
Examples
set.seed(12); rfactor(n = 20L, prob = c(4,2,3))
set.seed(12); rfactor(n = 20L, prob = c(a = 4, b = 2, c = 3))