title: R - calculating mean of every 3 values in array using a for loop
body: <p>Very new to programming - I have an array with dimension 821 and I would like to take the average of every 3 values. Each line represents monthly data and I need the quarterly averages (so every 3 months). I want to do it using for loops for practice but I cannot figure it out.  </p>