You have to be aware that R works very different from the data step in SAS. The
lag
function in SAS is used in the data step, and is used within the implicit loop structure of that data step. The same goes for the retain
function, which simply keeps the value constant when going through the data looping.
R on the other hand works completely vectorized. This means that you have to rethink what you want to do, and adapt accordingly.
No comments:
Post a Comment