coords

0th

Percentile

Extract Coordinates of a Spatial or Spatiotemporal Point Pattern

Given any kind of spatial or space-time point pattern, this function extracts the (space and/or time) coordinates of the points and returns them as a data frame.

Keywords
manip, spatial
Usage
coords(x, ...)
  ## S3 method for class 'ppp':
coords(x, ...)
  ## S3 method for class 'ppx':
coords(x, ..., spatial = TRUE, temporal = TRUE)
Arguments
x
A point pattern: either a two-dimensional point pattern (object of class "ppp"), a three-dimensional point pattern (object of class "pp3"), or a general multidimensional space-time point pattern (object of class
...
Further arguments passed to methods.
spatial,temporal
Logical values indicating whether to extract spatial and temporal coordinates, respectively. The default is to return both spatial and temporal coordinates.
Details

The function coords is generic, with methods for the classes "ppp") and "ppx". An object of class "pp3" also inherits from "ppx" and is handled by the method for "ppx".

Value

  • A data.frame with one row for each point, containing the coordinates.

See Also

ppx, pp3, ppp, as.hyperframe.ppx, as.data.frame.ppx.

Aliases
  • coords
  • coords.ppp
  • coords.ppx
Examples
df <- data.frame(x=runif(4),y=runif(4),t=runif(4))
   X <- ppx(data=df, temporal="t")
   coords(X)
   coords(X, temporal=FALSE)
Documentation reproduced from package spatstat, version 1.17-1, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.