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

marks.psp

Marks of a Line Segment Pattern


Description

Extract or change the marks attached to a line segment pattern.

Usage

## S3 method for class 'psp'
marks(x, ..., dfok=TRUE)           
## S3 replacement method for class 'psp'
marks(x, ...) <- value

Arguments

x

Line segment pattern dataset (object of class "psp").

...

Ignored.

dfok

Logical. If FALSE, data frames of marks are not permitted and will generate an error.

value

Vector or data frame of mark values, or NULL.

Details

These functions extract or change the marks attached to each of the line segments in the pattern x. They are methods for the generic functions marks and marks<- for the class "psp" of line segment patterns.

The expression marks(x) extracts the marks of x. The assignment marks(x) <- value assigns new marks to the dataset x, and updates the dataset x in the current environment.

The marks can be a vector, a factor, or a data frame.

For the assignment marks(x) <- value, the value should be a vector or factor of length equal to the number of segments in x, or a data frame with as many rows as there are segments in x. If value is a single value, or a data frame with one row, then it will be replicated so that the same marks will be attached to each segment.

To remove marks, use marks(x) <- NULL or unmark(x).

Value

For marks(x), the result is a vector, factor or data frame, containing the mark values attached to the line segments of x. If there are no marks, the result is NULL.

For marks(x) <- value, the result is the updated line segment pattern x (with the side-effect that the dataset x is updated in the current environment).

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

m <- data.frame(A=1:10, B=letters[1:10])
  X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin(), marks=m)

  marks(X) 
  marks(X)[,2]
  marks(X) <- 42
  marks(X) <- NULL

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.