Divide Multidimensional Point Pattern into Sub-patterns
Divides a multidimensional point pattern into several sub-patterns, according to their marks, or according to any user-specified grouping.
## S3 method for class 'ppx': split(x, f = marks(x), drop=FALSE, un=NULL, ...)
- A multi-dimensional point pattern.
An object of class
- Data determining the grouping. Either a factor, or the name of one of the columns of marks.
- Logical. Determines whether empty groups will be deleted.
- Logical. Determines whether the resulting subpatterns will be unmarked (i.e. whether marks will be removed from the points in each subpattern).
- Other arguments are ignored.
The generic command
split allows a dataset to be separated
into subsets according to the value of a grouping variable.
split.ppx is a method for the generic
split for the class
"ppx" of multidimensional
point patterns. It divides up the points of the point pattern
into several sub-patterns according to the values of
The result is a list of point patterns.
f may be
- a factor, of length equal to the number of points in
x. The levels of
fdetermine the destination of each point in
ith point of
xwill be placed in the sub-pattern
l = f[i].
- a character string, matching the name of one of the columns of
marks(x)is a data frame. This column should be a factor.
fis missing, then it will be determined by the marks of the point pattern. The pattern
xcan be either
- a multitype point pattern
(a marked point pattern whose marks vector is a factor).
fis taken to be the marks vector. The effect is that the points of each type are separated into different point patterns.
- a marked point pattern with a data frame or hyperframe
of marks, containing at least one
column that is a factor. The first such column will be used to
determine the splitting factor
Some of the sub-patterns created by the split
may be empty. If
drop=TRUE, then empty sub-patterns will
be deleted from the list. If
drop=FALSE then they are retained.
un determines how to handle marks
in the case where
x is a marked point pattern.
un=TRUE then the marks of the
points will be discarded when they are split into groups,
un=FALSE then the marks will be retained.
un are both missing,
then the default is
un=TRUE for multitype point patterns
un=FALSE for marked point patterns with a data frame of
The result of
split.ppx has class
"listof". There are methods for
- A list of point patterns.
The components of the list are named by the levels of
f. The list also has the class
df <- data.frame(x=runif(4),y=runif(4),t=runif(4), age=rep(c("old", "new"), 2), size=runif(4)) X <- ppx(data=df, coord.type=c("s","s","t","m","m")) X split(X)