Diff | R Documentation |
Diff within clusters based on a time vector with possibly unequal intervals
Diff(xx, ...)
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 |
return the value of x - x in the position 'idx - lag' in the same cluster
LagI
, DiffI
, Diff
,
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.