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) ?

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to