問題:
I have a nested list of data.我有一個嵌套的數據列表。 Its length is 132 and each item is a list of length 20. Is there a quick way to convert this structure into a data frame that has 132 rows and 20 columns of data?它的長度是 132,每一項都是一個長度爲 20 的列表。有沒有一種快速的方法可以把這個結構轉換成一個有 132 行和 20 列數據的數據框?
Here is some sample data to work with:以下是一些可以使用的示例數據:
l <- replicate(
132,
as.list(sample(letters, 20)),
simplify = FALSE
)
解決方案:
參考一: https://en.stackoom.com/question/Hjh1參考二: https://stackoom.com/question/Hjh1