Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unstack.ppp

Separate Multiple Columns of Marks


Description

Given a spatial pattern with several columns of marks, take one column at a time, and return a list of spatial patterns each having only one column of marks.

Usage

## S3 method for class 'ppp'
unstack(x, ...)

## S3 method for class 'psp'
unstack(x, ...)

## S3 method for class 'tess'
unstack(x, ...)

Arguments

x

A spatial point pattern (object of class "ppp") or a spatial pattern of line segments (object of class "psp") or a spatial tessellation (object of class "tess").

...

Ignored.

Details

The functions defined here are methods for the generic unstack. The functions expect a spatial object x which has several columns of marks; they separate the columns, and return a list of spatial objects, each having only one column of marks.

If x has several columns of marks (i.e. marks(x) is a matrix, data frame or hyperframe with several columns), then y <- unstack(x) is a list of spatial objects, each of the same kind as x. The jth entry y[[j]] is equivalent to x except that it only includes the jth column of marks(x).

If x has no marks, or has only a single column of marks, the result is a list consisting of one entry, which is x.

Value

A list, of class "solist", whose entries are objects of the same type as x.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

See also methods for the generic split such as split.ppp.

Examples

finpines
   unstack(finpines)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.