Learn R Programming

spatstat.linnet (version 3.2-2)

unstack.lpp: Separate Multiple Columns of Marks

Description

Given a spatial pattern on a network, 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 lpp
unstack(x, ...)

# S3 method for lintess unstack(x, ...)

Value

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

Arguments

x

A spatial point pattern (object of class "lpp") or a tessellation on a linear network (object of class "lintess").

...

Ignored.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

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.

See Also

unstack

unstack.ppp, unstack.msr.

See also methods for the generic split such as split.ppx which applies to "lpp" objects.

Examples

Run this code
   X <- runiflpp(5, simplenet)
   marks(X) <- data.frame(id=1:5, code=factor(letters[1:5]))
   unstack(X)

Run the code above in your browser using DataLab