[R] Choose every second value

Walther, Alexander awalthermail at googlemail.com
Sun Jan 17 12:20:10 CET 2010


Dear list,

is there a command that selects every second value from a given vector?
For instance,

a <- c(1,2,3,4,5,6)

should yield

1,3,5

and

2,4,6

which i intend to place into two seperate vectors.


best

Alex



More information about the R-help mailing list