Class of Point Patterns
"ppp" to represent a two-dimensional point
pattern. Includes information about the window in which the
pattern was observed. Optionally includes marks.
This class represents a two-dimensional point pattern dataset. It specifies
- the locations of the points
- the window in which the pattern was observed
- optionally, ``marks'' attached to each point (extra information such as a type label).
Xis an object of type
ppp, it contains the following elements:
xvector of $x$ coordinates of data points
yvector of $y$ coordinates of data points
nnumber of points
windowwindow of observation (an object of class
marksoptional vector or data frame of marks } Users are strongly advised not to manipulate these entries directly. Objects of class
"ppp"may be created by the function
pppand converted from other types of data by the function
as.ppp. Note that you must always specify the window of observation; there is intentionally no default action of ``guessing'' the window dimensions from the data points alone.
Standard point pattern datasets provided with the package
data(xxx) to access the dataset
Point patterns may be scanned from your own data files by
scanpp or by using
They may be manipulated by the functions
There are also methods for
summary(X) to see a useful description
of the data.
Patterns may be generated at random by
The internal representation of marks is likely to change in the next release of this package.
x <- runif(100) y <- runif(100) X <- ppp(x, y, c(0,1),c(0,1)) X plot(X) mar <- sample(1:3, 100, replace=TRUE) mm <- ppp(x, y, c(0,1), c(0,1), marks=mar) plot(mm) # points with mark equal to 2 ss <- mm[ mm$marks == 2 , ] plot(ss) # left half of pattern 'mm' lu <- owin(c(0,0.5),c(0,1)) mmleft <- mm[ , lu] plot(mmleft) # input data from file qq <- scanpp("my.table", unit.square()) # interactively build a point pattern plot(unit.square()) X <- as.ppp(locator(10), unit.square()) plot(X)