Diff: Contextual diff

View source: R/lag.R

DiffR Documentation

Contextual diff

Description

Diff within clusters based on a time vector with possibly unequal intervals

Usage

Diff(xx, ...)

Arguments

x

vector to be lagged

id

clustering variable

idx

time variable

lag

(default 1)

at

alternative to 'lag': evaluate x at a particular value of 'idx'

check

(default TRUE) check for unique values of idx within each cluster

Value

return the value of x - x in the position 'idx - lag' in the same cluster

See Also

LagI, DiffI, Diff,


gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.