[R] Simple for-loop runs out of memory

Astrix ast_rix85 at hotmail.com
Tue Mar 16 23:51:35 CET 2010

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.names(FTSE)[i]){	
		} else {


I have no idea why it crashes, it should be a very simple task of running
through the 1200 entries. The if loop is called only about 10 times during
the entire loop.
What could be the problem?
View this message in context: http://n4.nabble.com/Simple-for-loop-runs-out-of-memory-tp1595698p1595698.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list