eDiff {expandFunctions}R Documentation

Matrix size-preserving diff function

Description

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

Usage

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

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

[Package expandFunctions version 0.1.0 Index]