r 将嵌套列表转换为R中的数据帧

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 将嵌套列表转换为R中的数据帧相关的知识,希望对你有一定的参考价值。

library(plyr)

nested_list <- list(
  a = list(
    x = 1,
    y = 2
  ),
  b = list(
    x = 3,
    y = 4
  )
)

ldply(nested_list, data.frame, .id = "Name")
#Name x y
#1    a 1 2
#2    b 3 4

# https://stackoverflow.com/questions/39865079/r-convert-nested-list-into-dataframe

以上是关于r 将嵌套列表转换为R中的数据帧的主要内容,如果未能解决你的问题,请参考以下文章