Combing a list of unequal data.frames

后端 未结 3 1321
灰色年华
灰色年华 2020-12-22 01:15

I\'m trying to combine a list of unequal data.frames; the obvious do.call(rbind, df.lst) fails but the real problem is padding it out with NAs.

3条回答
  •  暖寄归人
    2020-12-22 01:37

    We can use

    library(dplyr)
    bind_rows(df.lst)
    

    Or

    library(data.table)
    rbindlist(df.lst, fill=TRUE)
    

提交回复
热议问题