R - I have a dataframe, with 0 and 1 in a column , I found out the row index at which the toggling takes place, now I want to sample out data from these by setting these particular row IDS? This is the data:
row id mode
1 0
2 0
3 1
4 1
5 0
6 0
7 0
8 1
9 1
10 1
After splitting dataframe there should be 4 new dataframes:
y[1] :
row id mode
1 0
2 0
y[2]
row id mode
3 1
4 1
y[3]
row id mode
5 0
6 0
7 0
And so on.