split.ppx: Divide Multidimensional Point Pattern into Sub-patterns

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/split.ppx.R

Description

Divides a multidimensional point pattern into several sub-patterns, according to their marks, or according to any user-specified grouping.

Usage

1
2
  ## S3 method for class 'ppx'
split(x, f = marks(x), drop=FALSE, un=NULL, ...)

Arguments

x

A multi-dimensional point pattern. An object of class "ppx".

f

Data determining the grouping. Either a factor, or the name of one of the columns of marks.

drop

Logical. Determines whether empty groups will be deleted.

un

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.

Details

The generic command split allows a dataset to be separated into subsets according to the value of a grouping variable.

The function 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 x into several sub-patterns according to the values of f. The result is a list of point patterns.

The argument f may be

If f is missing, then it will be determined by the marks of the point pattern. The pattern x can be either

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.

The argument un determines how to handle marks in the case where x is a marked point pattern. If un=TRUE then the marks of the points will be discarded when they are split into groups, while if un=FALSE then the marks will be retained.

If f and un are both missing, then the default is un=TRUE for multitype point patterns and un=FALSE for marked point patterns with a data frame of marks.

The result of split.ppx has class "splitppx" and "anylist". There are methods for print, summary and plot.

Value

A list of point patterns. The components of the list are named by the levels of f. The list also has the class "splitppx" and "anylist".

Author(s)

\adrian

and \rolf

See Also

ppx, plot.anylist

Examples

1
2
3
4
5
6
   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)

spatstat documentation built on Oct. 9, 2017, 1:05 a.m.