[R] Loop avoidance and logical subscripts

retama retama1745 at gmail.com
Thu May 21 15:12:20 CEST 2009


I'm writing a script with a lot of loops and it executes really slowly over
huge amounts of data. I assume it's because I don't know how to avoid using
loops. Logical subscripts are more desirable, but I don't know how to
implement them. One example of that issue:

GCsequence <- vector()
	for( i in 1:(length(data$sequence))) {

How should I speed up that? 

Thank you, 

View this message in context: http://www.nabble.com/Loop-avoidance-and-logical-subscripts-tp23652935p23652935.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list