Learn R Programming

expandFunctions (version 0.1.0)

eDiff: 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

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

Run the code above in your browser using DataLab