matthieugomez / statar

R package for data manipulation — inspired by Stata's API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clarify what is the purpose of tlag tlead?

randomgambit opened this issue · comments

commented

Hi Matthieu,

I am reading your documentation about tlag and tlead and I dont get what they are supposed to do. Of course, I know the L. and F. operator in Stata but why are you saying that your function applies to any vector? It is not possible to shift any column with dplyr already?

tlag/tlead a vector with respect to a number of periods, not with respect to the number of rows. Suppose you have a time variable with missing date, say [1992, 1994], this matters.

commented

got it