setmarks {spatstat}R Documentation

Set or Reset the Marks in a Point Pattern

Description

Create a marked point pattern from given point locations and given marks.

Usage

  setmarks(X, m)
  X 

Arguments

X Point pattern (object of class "ppp")
m Vector of mark values (of any atomic mode)

Details

This function is a shortcut which creates a marked point pattern from a given point pattern X and a given vector m by attaching the marks in m to the locations of the points in X.

If X is already a marked point pattern, then its marks are ignored and replaced by the values in m.

The length of m must agree with the number of points in X.

Use unmark to remove marks. Use ppp to create point patterns in more general situations.

Value

Marked point pattern (object of class "ppp") identical to X except that it has marks equal to m.

Author(s)

Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf

See Also

unmark, ppp.object, is.marked, is.marked.ppp

Examples

   require(spatstat)
   data(cells)

   m <- runif(cells$n)

   Y <- setmarks(cells, m)
   Y <- cells 
   # equivalent

   plot(Y)
   is.marked(Y)  #TRUE

[Package Contents]