as.data.frame.psp {spatstat}R Documentation

Coerce Line Segment Pattern to a Data Frame

Description

Extracts the coordinates of the endpoints in a line segment pattern, and their marks if any, and returns them in a data frame.

Usage

## S3 method for class 'psp':
as.data.frame(x, row.names = NULL, ...)

Arguments

x Line segment pattern (object of class "psp").
row.names Optional character vector of row names.
... Ignored.

Details

This is a method for the generic function as.data.frame for the class "psp" of line segment patterns.

It extracts the coordinates of the endpoints of the line segments, and returns them as columns named x0, y0, x1 and y1 in a data frame. If the line segments were marked, the marks are returned as a column named marks in the data frame, with the same type as in the line segment pattern dataset.

Value

A data frame with 4 or 5 columns.

Author(s)

Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz

Examples

  data(copper)
  df <- as.data.frame(copper$Lines)

[Package spatstat version 1.16-0 Index]