| bind.fv {spatstat.explore} | R Documentation |
Combine Function Value Tables
Description
Advanced Use Only.
Combine objects of class "fv",
or glue extra columns of data onto an existing "fv" object.
Usage
## S3 method for class 'fv'
cbind(...)
bind.fv(x, y, labl = NULL, desc = NULL, preferred = NULL, clip=FALSE)
Arguments
... |
Any number of arguments, which are objects of class |
x |
An object of class |
y |
Either an object of class |
labl |
Plot labels (see |
desc |
Descriptions (see |
preferred |
Character string specifying the column which is to be the new recommended value of the function. |
clip |
Logical value indicating whether each object must have exactly the
same domain, that is, the same sequence of values of the function argument
( |
Details
This documentation is provided for experienced programmers who want to modify the internal behaviour of spatstat.
The function cbind.fv is a method for the generic
R function cbind. It combines any number of
objects of class "fv" into a single object of
class "fv". The objects must be compatible, in the sense
that they have identical values of the function argument.
The function bind.fv is a lower level
utility which glues additional columns onto an
existing object x of class "fv".
It has three modes of use:
-
If the additional dataset
yis an object of class"fv", thenxandymust be compatible as described above. Then the columns ofythat contain function values will be appended to the objectx. -
Alternatively if
yis a data frame, thenymust have the same number of rows asx. All columns ofywill be appended tox. -
Alternatively if
yis a function in the R language, then this function will be evaluated at the argument values stored in the objectx, and these function values will be appended as a new column tox.
The arguments labl and desc provide
plot labels and description strings (as described in fv)
for the new columns. If y is an object of class
"fv" then labl and desc are optional, and
default to the relevant entries in the object y.
If y is a data frame then
labl and desc should be provided, but there is a
default.
For additional flexibility, cbind.fv also accepts arguments
which are data frames or functions.
Value
An object of class "fv".
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.
See Also
fv for creating objects of class "fv" from raw data.
collapse.fv for combining several "fv" objects
with similar columns.
with.fv for evaluating expressions.
fvnames for extracting and assigning the column names
of standard components of "fv" objects.
Undocumented functions for modifying an "fv" object
include tweak.fv.entry and rebadge.fv.
Examples
K1 <- Kest(cells, correction="border")
K2 <- Kest(cells, correction="iso")
# remove column 'theo' to avoid duplication
K2 <- K2[, names(K2) != "theo"]
cbind(K1, K2)
bind.fv(K1, K2, preferred="iso")
# constrain border estimate to be monotonically increasing
bm <- cumsum(c(0, pmax(0, diff(K1$border))))
bind.fv(K1, data.frame(bmono=bm),
"%s[bmo](r)",
"monotone border-corrected estimate of %s",
"bmono")
# add a column of values defined by a function
cbind(K1, upper=function(r) { pi * r^2 + 0.1 })