Learn R Programming

dbmss (version 2.9-2)

rRandomPositionK: Simulations of a point pattern according to the null hypothesis of random position defined for K

Description

Simulations of a point pattern according to the null hypothesis of random position defined for K.

Usage

rRandomPositionK(X, Precision = 0, CheckArguments = TRUE)

Value

A new weighted, marked, planar point pattern (an object of class wmppp, see wmppp.object).

Arguments

X

A weighted, marked, planar point pattern (wmppp.object).

Precision

Accuracy of point coordinates, measured as a part of distance unit. See notes. Default is 0 for no approximation.

CheckArguments

Logical; if TRUE, the function arguments are verified. Should be set to FALSE to save time in simulations for example, when the arguments have been checked elsewhere.

Details

Points marks are kept unchanged and their position is drawn in a binomial process by runifpoint.

See Also

rRandomLocation

Examples

Run this code
# Simulate a point pattern with two types
X <- rpoispp(5) 
PointType   <- sample(c("A", "B"), X$n, replace=TRUE)
PointWeight <- runif(X$n, min=1, max=10)
X$marks <- data.frame(PointType, PointWeight)
X <- as.wmppp(X)

autoplot(X, main="Original pattern")

# Randomize it
Y <- rRandomPositionK(X)
# Points are randomly distributed
autoplot(Y, main="Randomized pattern")

Run the code above in your browser using DataLab