
  
  
  
  
     Dear R Users,
  
 Suppose we are  interested for generating a new vector ( x ) from a current vector (y)  of length 1000 so that x includes the sum of every 5 values in y  respectively from the first to the end of length y. The same length of  y for x is desired, so that other 4 positions (indices) in x are filled  out with NA.
  
  For generating such a new vector, I have no idea. I tried in some ways  but all were wrong and therefore I do not want to confuse you.
  How could such a purpose be coded?
  Please help me with any idea. Thank you so much for help.
  Amir Safari

