Learn R Programming

dbmss (version 1.2.4)

RandomLabeling.M: Simulations of a point pattern according to the null hypothesis of random labelling defined for M

Description

Simulates of a point pattern according to the null hypothesis of random labelling defined for M

Usage

RandomLabeling.M(X)

Arguments

X
A point pattern (ppp.object), marks must be a dataframe with two columns: PointType: labels, as factors. PointWeight: weights.

Value

  • A new point pattern (an object of class ppp.object).

Details

Point types are randomized, keeping locations and weights unchanged.

References

Marcon, E. and Puech, F. (2010). Measures of the Geographic Concentration of Industries: Improving Distance-Based Methods. Journal of Economic Geography 10(5): 745-762. Marcon, E., F. Puech, et al. (2012). Characterizing the relative spatial structure of point patterns. International Journal of Ecology 2012(Article ID 619281): 11.

See Also

PopulationIndependence.M, PopulationIndependence.K, RandomPosition.K

Examples

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

par(mfrow=c(2,2))
plot(X, main="Original pattern, Point Type")
X$marks <- data.frame(PointWeight=X$marks$PointWeight, PointType=X$marks$PointType)
plot(X, main="Original pattern, Point Weight")

# Randomize it
Y <- RandomLabeling.M(X)
Z <- Y
# Invert the order of columns in mark to plot the point type, not the point weight
Y$marks <- data.frame(PointType=Y$marks$PointType, PointWeight=Y$marks$PointWeight)
# Labels have been redistributed randomly accross locations
plot(Y, main="Randomized pattern, Point Type")
# But weights are unchanged
Y <- Z
plot(Y, main="Randomized pattern, Point Weight")

Run the code above in your browser using DataLab