[R] behavior of seq_along

Dale Steele dale.w.steele at gmail.com
Thu Feb 25 15:02:01 CET 2010


I'm trying to understand the behavior of seq_along in the following example:

x <- 1:5; sum(x)
y <- 6:10; sum(y)

data <- c(x,y)
S <- sum( data[seq_along(x)] )
S
T <- sum( data[seq_along(y)] )
T

Why is T != sum(y) ?



More information about the R-help mailing list