Learn R Programming

spatstat (version 1.56-1)

ppx: Multidimensional Space-Time Point Pattern

Description

Creates a multidimensional space-time point pattern with any kind of coordinates and marks.

Usage

ppx(data, domain=NULL, coord.type=NULL, simplify=FALSE)

Arguments

data

The coordinates and marks of the points. A data.frame or hyperframe.

domain

Optional. The space-time domain containing the points. An object in some appropriate format, or NULL.

coord.type

Character vector specifying how each column of data should be interpreted: as a spatial coordinate, a temporal coordinate, a local coordinate or a mark. Entries are partially matched to the values "spatial", "temporal", "local" and "mark".

simplify

Logical value indicating whether to simplify the result in special cases. If simplify=TRUE, a two-dimensional point pattern will be returned as an object of class "ppp", and a three-dimensional point pattern will be returned as an object of class "pp3". If simplify=FALSE (the default) then the result is always an object of class "ppx".

Value

Usually an object of class "ppx". If simplify=TRUE the result may be an object of class "ppp" or "pp3".

Details

An object of class "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, any number of local coordinates, and any number of mark variables. The individual marks may be atomic (numeric values, factor values, etc) or objects of any kind.

The argument data should contain the coordinates and marks of the points. It should be a data.frame or more generally a hyperframe (see hyperframe) with one row of data for each point.

Each column of data is either a spatial coordinate, a temporal coordinate, a local coordinate, or a mark variable. The argument coord.type determines how each column is interpreted. It should be a character vector, of length equal to the number of columns of data. It should contain strings that partially match the values "spatial", "temporal", "local" and "mark". (The first letters will be sufficient.)

By default (if coord.type is missing or NULL), columns of numerical data are assumed to represent spatial coordinates, while other columns are assumed to be marks.

See Also

pp3, print.ppx

Examples

Run this code
# NOT RUN {
   df <- data.frame(x=runif(4),y=runif(4),t=runif(4),
                    age=rep(c("old", "new"), 2),
                    size=runif(4))
   X <- ppx(data=df, coord.type=c("s","s","t","m","m"))
   X

   val <- 20 * 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))
   Z
# }

Run the code above in your browser using DataLab