"deriv"(expr, which = "*", ..., method=c("spline", "numeric"), kinks=NULL, periodic=FALSE, Dperiodic=periodic)
"fv"
,
see fv.object
).
"*"
or "."
explained below.
smooth.spline
to control the differentiation algorithm, if method="spline"
.
"spline"
or "numeric"
.
expr
is periodic.
"fv"
)
of the same format.
"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.
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)
Run the code above in your browser using DataLab