eDiff: Matrix size-preserving diff function

Description Usage Arguments Value Examples

View source: R/expandFunctions.R

Description

Returns a matrix, the same size as the input matrix X, containing the back difference.

Usage

1
eDiff(X, pad = NA)

Arguments

X

R object coercible to matrix

pad

Pad the first row with this value; the default is NA. 0 would be another value often used in signal processing.

Value

Returns a matrix, the same size as the input matrix X, containing the back difference by column. The first row is filled with copies of pad.

Examples

1
2
3
eDiff( 1:8 )
eDiff( as.data.frame(1:8) )
eDiff( matrix(1:8,ncol=2) )

expandFunctions documentation built on May 2, 2019, 9:15 a.m.