so I have a CSV file that I imported into R studio. I ran my analysis and then was informed that there was a mistake with the data collection. Every 4 rows actually represents 1 month. But what I need to do is leave first row alone and combine (aggregate) the next 3 rows into one. The head of my data looks like this:
X2 X3 X4 X5 X6 X7
1 3830 0 0 1184 0 5765
2 0 0 153 0 153 153
3 0 0 0 73 73 0
4 0 0 153 0 153 0
5 3815 0 3354 651 903 5174
6 0 0 138 101 273 558
7 0 0 322 0 272 322
8 0 0 0 101 273 420
9 0 0 3682 3302 83 6485
10 165 0 63 0 293 165
11 0 0 98 98 0 0
12 0 0 0 0 230 0
So basically I want to leave row 1 alone and combine rows 2,3,and 4 combined into one new row. Leave row 5 alone, combine 6,7, and 8 into another etc. So lets say for column 76, I would want a new row that says 5765 for row 1 then 13 for sum row 2 through 4. What is the easiest way to go about doing this in R?