R list of lists to data.frame

前端 未结 5 1304
夕颜
夕颜 2020-11-27 19:12

I\'ve got a list of lists, call it listHolder, which has length 5.

Every element in listHolder is a list of numeric data, with 160 or so e

5条回答
  •  伪装坚强ぢ
    2020-11-27 19:26

    This is the easiest solution I've found.

    library(jsonlite)
    library(purrr)
    library(data.table)
    
    dt_list <- map(list_of_lists, as.data.table)
    dt <- rbindlist(dt_list, fill = TRUE, idcol = T)
    
    dt
    

提交回复
热议问题