This question涵蓋的情況下,我有一個列的列表,我希望把它們變成一個data.frame。如果我有一個行列表,我希望將它們變成一個data.frame?最有效的列表data.frame方法,當列表是行列表
rowList <- lapply(1:500000,function(x) sample(0:1,300,x))
解決這個天真的方法是使用rbind
和as.data.frame
,但我們甚至不能讓過去的rbind
步:
>Data <- do.call(rbind,vectorList)
Error: cannot allocate vector of size 572.2 Mb
什麼是更有效地做到這一點?
可能重複的[最有效的列表data.frame方法?](http://stackoverflow.com/questions/5942760/most-efficient-list-to-data-frame-method) – 2012-01-06 20:41:18
@JoshuaUlrich - 是你確定它是重複的?扎克正在詢問有關將一組載體連接在一起的問題。在你的鏈接文章中檢查的方法似乎都是通過''cbind'ing'或其他方式組合列來構建data.frames。 – 2012-01-06 20:59:24
@ JoshO'Brien:好點。 Zach需要澄清,尤其是因爲'do.call(rbind,vectorList)'會創建一個矩陣,而不是data.frame。 – 2012-01-06 21:04:24