Evaluate Expression Involving Functions
Evaluates any expression involving one or more function value (fv) objects, and returns another object of the same kind.
- An expression.
- Optional. The environment in which to evaluate the expression.
This is a wrapper to make it easier to perform pointwise calculations with the summary functions used in spatial statistics.
An object of class
"fv" is essentially a data frame
containing several different statistical estimates of the same
function. Such objects are returned by
Kest and its
For example, suppose
X is an object of class
containing several different estimates of the Ripley's K function $K(r)$,
evaluated at a sequence of values of $r$.
eval.fv(X+3) effectively adds 3 to
each function estimate in
X, and returns
the resulting object.
Y are two objects of class
which are compatible (in particular they have the same vector
of $r$ values). Then
eval.im(X + Y) will add the corresponding function values in
Y, and return the resulting function.
expr can be any expression involving
(a) the names of objects of class
"fv", (b) scalar
constants, and (c) functions which are vectorised.
See the Examples.
eval.fv determines which of the variable names
in the expression
expr refer to objects of class
Each such name is replaced by a vector containing the function values.
The expression is then evaluated. The result should be a vector;
it is taken as the new vector of function values.
expr must be vectorised.
There must be at least one object of class
"fv" in the expression.
All such objects must be compatible.
- Another object of class
# manipulating the K function X <- rpoispp(42) Ks <- Kest(X) eval.fv(Ks + 3) Ls <- eval.fv(sqrt(Ks/pi)) # manipulating two K functions Y <- rpoispp(20) Kr <- Kest(Y) Kdif <- eval.fv(Ks - Kr) Z <- eval.fv(sqrt(Ks/pi) - sqrt(Kr/pi))