Skip to content
Prev 334420 / 398506 Next

iterated sum

On 14-Dec-2013 10:46:10 ???????? wrote:
x <- c(1,4,9,20,3,7)
  N <- length(x)

  x[1:(N-1)] + x[2:N]
  # [1]  5 13 29 23 10

Best wishes,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 14-Dec-2013  Time: 10:54:00
This message was sent by XFMail