I have a large dataframe, I'd like to split this into multiple smaller data frames of equal parts.
A sample df:
df <- data.frame(x = 1:100, y = runif(100))
I have the code that splits them into equal parts (let's say 10 dataframes of 10 rows each)
x=split(df, (seq(nrow(df))-1) %/% 10)
and stores them in a list x
, but I can't seem to figure out how to convert each part of x
to a separate dataframe.
I tried to use lapply
but my method didn't work out the way I wanted to
Any ideas?