annoying looping bugs in R
Feb. 19th, 2010 10:43 pmIn R, you loop over your list
But if
Another one has to do with operator precedence,
l as followsfor (i in 1:length(l))But if
length(l) is zero, you still visit the loop twice... I do not know an elegant solution to this.Another one has to do with operator precedence,
1:k+3 gets parsed as (1:k)+3 rather than 1:(k+3).
(no subject)
Date: 2010-02-27 12:51 am (UTC)