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

split.msr

Divide a Measure into Parts


Description

Decomposes a measure into components, each component being a measure.

Usage

## S3 method for class 'msr'
split(x, f, drop = FALSE, ...)

Arguments

x

Measure (object of class "msr") to be decomposed.

f

Factor or tessellation determining the decomposition. Argument passed to split.ppp. See Details.

drop

Logical value indicating whether empty components should be retained in the list (drop=FALSE, the default) or deleted (drop=TRUE).

...

Ignored.

Details

An object of class "msr" represents a signed (i.e. real-valued) or vector-valued measure in the spatstat package. See msr for explanation.

This function is a method for the generic split. It divides the measure x into components, each of which is a measure.

A measure x is represented in spatstat by a finite set of sample points with values attached to them. The function split.msr divides this pattern of sample points into several sub-patterns of points using split.ppp. For each sub-pattern, the values attached to these points are extracted from x, and these values and sample points determine a measure, which is a component or piece of the original x.

The argument f can be missing, if the sample points of x are multitype points. In this case, x represents a measure associated with marked spatial locations, and the command split(x) separates x into a list of component measures, one for each possible mark.

Otherwise the argument f is passed to split.ppp. It should be either a factor (of length equal to the number of sample points of x) or a tessellation (object of class "tess" representing a division of space into tiles) as documented under split.ppp.

Value

A list, each of whose entries is a measure (object of class "msr").

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

Examples

## split by tessellation
  a <- residuals(ppm(cells ~ x))
  aa <- split(a, dirichlet(runifpoint(4)))
  aa
  sapply(aa, integral)

  ## split by type of point
  b <- residuals(ppm(amacrine ~ marks + x))
  bb <- split(b)
  bb

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

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