"fv"
).## S3 method for class 'fv':
with(data, expr, ..., fun = NULL, enclos=NULL)
"fv"
)
in which the expression will be evaluated.data
,
the special abbreviations .
, .x
and .y
,
and global constants or functions.fun=TRUE
)
or simply returned as a numeric vector or array (fun=FALSE
).
See Details.data
. Defaults to parent.frame()
."fv"
)
or a numeric vector or data frame.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 Rlanguage 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; The interpretation of the argument fun
is as follows:
fun=FALSE
, the result of evaluating the expressionexpr
will be returned as a numeric vector, matrix or
data frame.fun=TRUE
, then the result of evaluatingexpr
will be interpreted as containing the values of a new function.
The return value will be an object of class"fv"
.
(This can only happen if the result has the right dimensions.)fun=TRUE
if the result of evaluatingexpr
has more than one column, andfun=FALSE
otherwise."fv"
, use eval.fv
.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)))
Run the code above in your browser using DataLab