with.fv {spatstat} | R Documentation |
Evaluate an R expression in a
function value table (object of class "fv"
).
## S3 method for class 'fv': with(data, expr, ..., drop = TRUE)
data |
A function value table (object of class "fv" )
in which the expression will be evaluated.
|
expr |
The expression to be evaluated. An R language
expression, which may involve the names of columns in data ,
the special abbreviations . , .x and .y ,
and global constants or functions.
|
... |
Ignored. |
drop |
Logical value. If the result of evaluating the expression
expr is a vector (rather than a matrix or data frame)
then the result will be returned as a vector if drop=TRUE .
Otherwise it will be returned as another function value table
(object of class "fv" ).
|
This is a method for the generic command with
for an object of class "fv"
(function value table).
An object of class "fv"
is a convenient way of storing and
plotting several different estimates of the same function. It is
effectively a data frame with extra attributes.
See fv.object
for further explanation.
This command makes it possible to perform computations that involve different estimates of the same function. For example we use it to compute the arithmetic difference between two different edge-corrected estimates of the K function of a point pattern.
The argument expr
should be an R language expression. The expression
may involve
data
, referring to
one of the estimates of the function;
.
which stands for all
the available estimates of the function;
.y
which stands for the recommended
estimate of the function (in an "fv"
object, one of the
estimates is always identified as the recommended estimate);
.x
which stands for the argument of the function;
See the Examples.
The expression should be capable of handling vectors and matrices.
If the result of evaluating the expression is a matrix or data frame,
then it is returned as a new function value table
(object of class "fv"
). If the result of evaluation is
a vector and drop=TRUE
then the result is returned as a vector.
To perform calculations involving several objects of
class "fv"
, use eval.fv
.
Either a function value table (object of class "fv"
)
or a vector.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
with
,
fv.object
,
eval.fv
,
Kest
# compute 4 estimates of the K function X <- rpoispp(42) K <- Kest(X) plot(K) # derive 4 estimates of the L function L(r) = sqrt(K(r)/pi) L <- with(K, sqrt(./pi)) plot(L) # compute 4 estimates of V(r) = L(r)/r V <- with(L, ./.x) plot(V) # compute the maximum absolute difference between # the isotropic and translation correction estimates of K(r) D <- with(K, max(abs(iso - trans)))