R-people, Duncan Murdoch's response in https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html reminded me of something I had been meaning to ask. A while ago I started using for(i in seq_len(v)) {....} in preference to for(i in 1:n) {....} Duncan's post shows that if n can be zero, there is an advantage to using seq_len. Is there ever a *dis*advantage? Peter Ehlers University of Calgary
On 12/02/2010, at 9:39 AM, Peter Ehlers wrote:> R-people, > > Duncan Murdoch's response in > > https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html > > reminded me of something I had been meaning to ask. > > A while ago I started using > > for(i in seq_len(v)) {....} > > in preference to > > for(i in 1:n) {....} > > Duncan's post shows that if n can be zero, there is > an advantage to using seq_len. > Is there ever a *dis*advantage?More key-strokes? cheers, Rolf ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
On 11/02/2010 3:39 PM, Peter Ehlers wrote:> R-people, > > Duncan Murdoch's response in > > https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html > > reminded me of something I had been meaning to ask. > > A while ago I started using > > for(i in seq_len(v)) {....} > > in preference to > > for(i in 1:n) {....} > > Duncan's post shows that if n can be zero, there is > an advantage to using seq_len. > Is there ever a *dis*advantage?I like to use 1:n when I'm teaching debugging, because it looks so safe but isn't. Duncan Murdoch