r - Split Data Frame into Rows of Fixed Size -
i have bunch of data frames varying degrees of length, ranging approx. 15,000 500,000. each of these data frames, split them smaller data frames each 300 rows further processing on. how can this?
this (split dataframe number of rows) provides partial answer, doesn't work because not data frames have length multiples of 300.
would appreciate if plyr , non-plyr solution can both provided.
thank you!
i don't understand why plyr solution needed. split
works , hadley himself didn't suggest plyr/reshape2 solution when looked @ earlier question:
split(dfrm, (0:nrow(dfrm) %/% 300) # modulo division
does produce warning since expecting non-evenly divisible result should ignore it.
Comments
Post a Comment