In R write list with several elements to data.frame

后端 未结 4 427
自闭症患者
自闭症患者 2021-01-29 05:51

I have a named list whose each element is a character vector. I want to write this list into a single dataframe where I have two columns, one with the name of the character vect

4条回答
  •  感动是毒
    2021-01-29 06:16

     NewList <- lapply(names(List), function(X) data.frame(Names=X, Characters=List[[X]]))
     do.call(rbind, NewList)
    

提交回复
热议问题