I need to split a dataframe every 30 rows to build a subset of it. Syntax would look like this, but I really need more clever way, since I have got 9600 rows.
x1 <- mtcars[1:3, ]
x2 <- mtcars[4:6, ]
x3 <- mtcars[7:9, ]
x4 <- mtcars[10:12, ]
Each subsets of mtcars has 3 rows. Is there a way to do this? A sample is not an option, every 30 rows contain a block of information which I have to summarise later.
Thank you!