Re: [R] Simple for-loop runs out of memory

2010-03-16 Thread jim holtman
Learn how to do some basic debugging. If you are running out of memory after 10 times, then you must be creating a large object and using up memory. Put: cat(i, memory.size(), '\n') In your loop to see how memory is being used. You might also look at the size of the objects you are creating.

[R] Simple for-loop runs out of memory

2010-03-16 Thread Astrix
I have the following simple for-loop, which makes R crash every time. The length of the vectors is about 1200 rows, 1 column. n = max(length(GSPC),length(FTSE)) for(i in 1:1000) { if (row.names(GSPC)[i]==row.names(FTSE)[i]){ } else { if (row.names(GSPC)[i]>row.nam