rRandomPositionK {dbmss}R Documentation

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


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


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



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


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


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.


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


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


Simulations in a binomial process keeps the same number of points, so that marks can be redistributed. If a real CSR simulation is needed and marks are useless, use rpoispp.

Actual data coordinates are often rounded. Use the Precision argument to simulate point patterns with the same rounding procedure. For example, if point coordinates are in meters and rounded to the nearest half meter, use Precision = 0.5 so that the same approximation is applied to the simulated point patterns.

See Also



# 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)

plot(X, main="Original pattern, Point Type")

# Randomize it
Y <- rRandomPositionK(X)
# Invert the order of columns in mark to plot the point type, not the point weight
Y$marks <- data.frame(Y$marks$PointType, Y$marks$PointWeight)
# Points are randomly distributed
plot(Y, main="Randomized pattern, Point Type")

[Package dbmss version 2.7-8 Index]