Computes the symbolic derivative of an R expression with respect to one or more target variables. If a single target is provided, it returns a scalar expression. If multiple targets are provided, it returns a named c() call.
Usage
Deriv_cpp(expr, x, env = parent.frame(), drule = Deriv::drule)Arguments
- expr
An R language object, symbol, or numeric constant to differentiate.
- x
A character vector, symbol, or named vector of targets.
- env
An environment to resolve function calls in (defaults to parent.frame()).
- drule
An environment containing derivative rules (cf. Details in
Derivfor syntax rules).
Details
This version is much faster for simple expressions but has less features than its R counterpart Deriv().