deriv.fv | R Documentation |
Applies numerical differentiation to the values in selected columns of a function value table.
## S3 method for class 'fv' deriv(expr, which = "*", ..., method=c("spline", "numeric"), kinks=NULL, periodic=FALSE, Dperiodic=periodic)
expr |
Function values to be differentiated.
A function value table (object of class |
which |
Character vector identifying which columns of the table
should be differentiated. Either a vector containing names
of columns, or one of the wildcard strings |
... |
Extra arguments passed to |
method |
Differentiation method. A character string, partially matched
to either |
kinks |
Optional vector of x values where the derivative is allowed to be discontinuous. |
periodic |
Logical value indicating whether the function |
Dperiodic |
Logical value indicating whether the resulting derivative should be a periodic function. |
This command performs numerical differentiation on the function values in
a function value table (object of class "fv"
).
The differentiation is performed either by
smooth.spline
or by
a naive numerical difference algorithm.
The command deriv
is generic. This is the
method for objects of class "fv"
.
Differentiation is applied to every column (or to each of the selected columns) of function values in turn, using the function argument as the x coordinate and the selected column as the y coordinate. The original function values are then replaced by the corresponding derivatives.
The optional argument which
specifies which of the
columns of function values in expr
will be differentiated.
The default (indicated by the wildcard which="*"
)
is to differentiate all function values, i.e.\ all columns except the
function argument. Alternatively which="."
designates
the subset of function values that are displayed in the default plot.
Alternatively which
can be a character vector containing the
names of columns of expr
.
If the argument kinks
is given, it should be a numeric vector
giving the discontinuity points of the function: the value or values
of the function argument at which the function is
not differentiable. Differentiation will be performed separately on
intervals between the discontinuity points.
If periodic=TRUE
then the function expr
is taken to be
periodic, with period equal to the range of the function
argument in expr
. The resulting derivative is periodic.
If periodic=FALSE
but Dperiodic=TRUE
, then the
derivative is assumed to be periodic. This would be
appropriate if expr
is the cumulative distribution function
of an angular variable, for example.
Another function value table (object of class "fv"
)
of the same format.
and \rolf
with.fv
,
fv.object
,
smooth.spline
G <- Gest(cells) plot(deriv(G, which=".", spar=0.5)) A <- pairorient(redwood, 0.05, 0.15) DA <- deriv(A, spar=0.6, Dperiodic=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.