Is there an easy way in R (i.e. without using a for loop) to break a data frame up based on a column that cycles through the same N+1
numbers z
times?
So here's an example:
column1: 0, 1, 2, 3, ..., N, 0, 1, 2, 3, ..., N, ......, 0, 1, 2, 3, ..., N
column2: (randomly distributed numbers of same length as column1)
I want **z**
of data frames that look like the following:
Df1:
column11: 0, 1, 2, 3, ..., N
column21: (randomly distributed numbers of same length as column1a)
.
.
.
Dfz:
column1**z**: 0, 1, 2, 3, ..., N
column2**z**: (randomly distributed numbers of same length as column1z)
Also, when I say I want **z**
data frames, I really just want a way to use the first N+1
data points, the 2nd N+1
data points, and so on.