Re: [R] List assignment in a while loop and timing

2009-03-31 Thread Adrian Dragulescu
Saptarhi, Here are some observations. It seems to me that your question is about assignment into long lists. 1) Initialize your list with a vector of NULLs. 2) If you can, try to use vectors rather then lists. It's faster by more than 30%. 3) If you get rid of the i <- i+1, you go even fas

[R] List assignment in a while loop and timing

2009-03-30 Thread Saptarshi Guha
Hello R users I have question about the time involved in list assignment. Consider the following code snippet(see below). The first line creates a reader object, which is the interface to 1MM key-value pairs (serialized R objects) spanning 50 files (a total of 50MB). rhsqstart initiates the reading