How can I keep the first 56 rows, then delete the next 6 rows, then keep the next 56 rows, then delete the next 6 rows repeatedly? I found some similar answers (like how to delete the Nth row), but not how to keep a pattern like mentioned.
My data is a data frame, 1 through 7910.
And I would like to Keep rows 1 through 56. Delete rows 57 through 62. Keep rows 63 through 118. Delete rows 119 through 124. And continue this pattern through all 7910 rows.
Thank you!
Using modulo (
%%) of the row number:The same with
dplyr: