cbind.hyperframe {spatstat.geom}R Documentation

Combine Hyperframes by Rows or by Columns

Description

Methods for cbind and rbind for hyperframes.

Usage

## S3 method for class 'hyperframe'
cbind(...)
## S3 method for class 'hyperframe'
rbind(...)

Arguments

...

Any number of hyperframes (objects of class hyperframe).

Details

These are methods for cbind and rbind for hyperframes.

Note that all the arguments must be hyperframes (because of the peculiar dispatch rules of cbind and rbind).

To combine a hyperframe with a data frame, one should either convert the data frame to a hyperframe using as.hyperframe, or explicitly invoke the function cbind.hyperframe or rbind.hyperframe.

In other words: if h is a hyperframe and d is a data frame, the result of cbind(h,d) will be the same as cbind(as.data.frame(h), d), so that all hypercolumns of h will be deleted (and a warning will be issued). To combine h with d so that all columns of h are retained, type either cbind(h, as.hyperframe(d)) or cbind.hyperframe(h,d).

Value

Another hyperframe.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

See Also

hyperframe, as.hyperframe

Examples

if(require(spatstat.random)) {
  lambda <- runif(5, min=10, max=30)
  X <- solapply(as.list(lambda), rpoispp)
  h <- hyperframe(lambda=lambda, X=X)
  g <- hyperframe(id=letters[1:5], Y=rev(X))
  gh <- cbind(h, g)
  hh <- rbind(h[1:2, ], h[3:5,])
}

[Package spatstat.geom version 3.3-2 Index]