0

Say I have a vector. I need to select every two elements. I need to do this in a loop and pass it on to different vector

for eg A<-c(1:10) i want to select elements like (1,2) (3,4),(5,6) and so on and pass the sum of these two elements into another vector. required output is (3,7,11,15)

Nithin .M
  • 85
  • 5
  • I added more relevant links, see if they are helpful. – zx8754 May 06 '19 at 09:51
  • The example in your edit seems completely different from what you first described. Search back through previous SO posts, but if you can't find something that helps, maybe you should post a different question with a [clear example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) of what you need to do – camille May 06 '19 at 13:34

0 Answers0