Re: [R] Equivalent of 'Retain' statement in R

From: Peter Dalgaard <>
Date: Mon, 21 May 2007 17:37:30 +0200

Shubha Vishwanath Karanth wrote:
> What is the equivalent keyword for 'retain' statement of SAS in R?
There is none. This is strongly linked to the sequential operation of the DATA step i SAS and R just does things differently. The lag() function sometimes helps, but you may need an explicit for() loop, or rethink the operation in vectorized terms.

   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 21 May 2007 - 16:05:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 May 2007 - 16:31:00 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.