Splitting a large data frame into smaller segments

后端 未结 5 787
你的背包
你的背包 2020-12-01 09:17

I have the following data frame and I want to break it up into 10 different data frames. I want to break the initial 100 row data frame into 10 data frames of 10 rows. I cou

5条回答
  •  Happy的楠姐
    2020-12-01 10:10

    require(ff)
    df <- data.frame(one=c(rnorm(1123)), two=c(rnorm(1123)), three=c(rnorm(1123)))
    for(i in chunk(from = 1, to = nrow(df), by = 200)){
      print(df[min(i):max(i), ])
    }
    

提交回复
热议问题