Suppose I have a dataframe with 100 rows of data. I want split the dataframe into multiple dataframe each containing 10 rows. For example, the first separated dataframe has index from 1 to 10, and the second dataframe will have an index from 2 to 11, and the third dataframe will have an index from 3 to 12, and so on. I will use this dataframe to make further analysis.
I have tried using the split() function, but I could only figure out a way to split the dataframe evenly. I thought using a loop would simplify it, but I haven't been able to make it work.
iterator <- seq(1,100,10)
for (i in iterator){
df[[i+1]] <- df[1:100,]
}
I tried something like this, but it did not show me the desired output.