coords {spatstat} | R Documentation |
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.
coords(x, ...) ## S3 method for class 'ppp' coords(x, ...) ## S3 method for class 'ppx' coords(x, ..., spatial = TRUE, temporal = TRUE) coords(x, ...) <- value ## S3 replacement method for class 'ppp' coords(x, ...) <- value ## S3 replacement method for class 'ppx' coords(x, ..., spatial = TRUE, temporal = TRUE) <- value
x |
A point pattern: either a two-dimensional 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. (Only relevant to |
value |
New values of the coordinates. A numeric vector with one entry for each
point in |
The function coords
extracts the coordinates from
a point pattern. The function coords<-
replaces the coordinates
of the point pattern with new values.
Both functions coords
and coords<-
are 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"
.
coords
returns a data.frame
with one row for each point,
containing the coordinates.
coords<-
returns the altered point pattern.
Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
ppx
,
pp3
,
ppp
,
as.hyperframe.ppx
,
as.data.frame.ppx
.
df <- data.frame(x=runif(4),y=runif(4),t=runif(4)) X <- ppx(data=df, temporal="t") coords(X) coords(X, temporal=FALSE) coords(X) <- matrix(runif(12), ncol=3)