Learn R Programming

ecd (version 0.9.2.4)

ecd.diff: Utility to diff a vector of numeric or mpfr to get first derivative

Description

This utility uses diff to get first derivative dy/dx. but it handles mpfr vector properly

Usage

ecd.diff(y, x, pad = 0)

Arguments

y

a vector of numeric or mpfr

x

a vector of numeric or mpfr

pad

integer, to manage padding so that the output vector has the same length as the input. 0 for no padding, 1 to repeat the first element, -1 to repeat the last element.

Value

the derivative vector

Examples

Run this code
# NOT RUN {
d <- ecd.diff(c(10,20,30), c(1,2,3), pad=1)

# }

Run the code above in your browser using DataLab