Skip to contents

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 Deriv for syntax rules).

Value

A simplified R expression (or a named c() call for multiple inputs).

Details

This version is much faster for simple expressions but has less features than its R counterpart Deriv().

See also