Mass rbind.fill for many data frames

后端 未结 4 1707
迷失自我
迷失自我 2020-12-20 03:04

I am attempting to row bind many data frames together into a single massive data frame. The data frames are named sequentially with the first named df1, the se

4条回答
  •  生来不讨喜
    2020-12-20 04:08

    Or with data.table::rbindlist . Set fill to true to take care of the missing values, if any.

    rbindlist(mget(ls(pattern="df")), fill=TRUE)
    
             x          y
        1:   1    1.00000
        2:   2   11.09091
        3:   3   21.18182
        4:   4   31.27273
        5:   5   41.36364
       ---               
     9996:  96  959.63636
     9997:  97  969.72727
     9998:  98  979.81818
     9999:  99  989.90909
    10000: 100 1000.00000
    

提交回复
热议问题