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

View source: R/ecd-diff-method.R

ecd.diffR Documentation

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

d <- ecd.diff(c(10,20,30), c(1,2,3), pad=1)


ecd documentation built on May 10, 2022, 1:07 a.m.