Re: [R] sequential processing

From: Gerard Smits <>
Date: Mon 22 Jan 2007 - 23:12:18 GMT

So, I take it, given that the use of a pipe is suggested for sequential reading, that the standard approach to processing a data frame is to load the entire file? Please correct if wrong.

BTW, I am not interested in finding direct translations of SAS data step statements to R, but instead in finding an approach by which I can address the type of problems I consistent have to deal with (grouped processing with retention of baseline records, etc.). I'll read more on the indexing as a means of dealing with relative position issues



>You could also load the entire file into a DBMS then pull parts of it
>into R, or read specific lines through a pipe e.g.
>readLines(pipe("sed, grep, python... command")).
>Don't try to replicate the SAS processing into R. The exact
>translations of the SAS DATA STEP usage of _N_, first., last., retain
>etc into R would be: inefficient, ugly, retrogressive, wrong, rigid,
>complicated, silly and so on. For a start, read up on indexing - this
>seemingly simple and innocuous R feature is in fact far more powerful
>than the entire DATA STEP with its whole bag of tricks. Then search
>the list for similar questions, for example
>>-----Original Message-----
>>[] On Behalf Of Gerard Smits
>>Sent: Sunday, January 21, 2007 2:22 PM
>>Subject: [R] sequential processing
>>Like many others, I am new to R but old to SAS.
>>Am I correct in understanding that R processes a data frame in a
>>sequential ly? This would imply that large input files could be
>>read, without the need to load the entire file into memory.
>>Related to the manner of reading a frame, I have been looking for the
>>equivalent of SAS _n_ (I realize that I can use a variant of which to
>>identify an index value) as well as useful SAS features such as
>>first., last., retain, etc. Any help with this conversion
>>Gerard Smits
>> mailing list
>>PLEASE do read the posting guide
>>and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue Jan 23 10:17:39 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 23 Jan 2007 - 08:30:34 GMT.

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