Extract coordinates and marks of multidimensional point pattern

Given any kind of spatial or space-time point pattern, extract the coordinates and marks of the points.

manip, spatial
## S3 method for class 'ppx':
as.hyperframe(x, ...)
## S3 method for class 'ppx':, ...)
## S3 method for class 'ppx':
as.matrix(x, ...)
A general multidimensional space-time point pattern (object of class "ppx").

An object of class "ppx" (see ppx) represents a marked point pattern in multidimensional space and/or time. There may be any number of spatial coordinates, any number of temporal coordinates, and any number of mark variables. The individual marks may be atomic (numeric values, factor values, etc) or objects of any kind.

The function as.hyperframe.ppx extracts the coordinates and the marks as a "hyperframe" (see hyperframe) with one row of data for each point in the pattern. This is a method for the generic function as.hyperframe.

The function discards those mark variables which are not atomic values, and extracts the coordinates and the remaining marks as a data.frame with one row of data for each point in the pattern. This is a method for the generic function

Finally as.matrix(x) is equivalent to as.matrix( for an object of class "ppx". Be warned that, if there are any columns of non-numeric data (i.e. if there are mark variables that are factors), the result will be a matrix of character values.


  • A hyperframe, data.frame or matrix as appropriate.

See Also

ppx, hyperframe, as.hyperframe.

  • as.hyperframe.ppx
  • as.matrix.ppx
df <- data.frame(x=runif(4),y=runif(4),t=runif(4))
   X <- ppx(data=df, coord.type=c("s","s","t"))
   val <- runif(4)
   E <- lapply(val, function(s) { rpoispp(s) })
   hf <- hyperframe(t=val, e=as.listof(E))
   Z <- ppx(data=hf, domain=c(0,1))
Documentation reproduced from package spatstat, version 1.31-3, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.