將數(shù)據(jù)幀列表轉(zhuǎn)換為一個(gè)數(shù)據(jù)幀我有代碼,在一個(gè)地方結(jié)束的數(shù)據(jù)幀列表,我真的想要轉(zhuǎn)換成一個(gè)單一的大數(shù)據(jù)框架。我從早期問題試圖做一些類似但更復(fù)雜的事情。下面是我開始講的一個(gè)例子(為了說明,這是非常簡化的):listOfDataFrames <- vector(mode = "list", length = 100)for (i in 1:100) {
listOfDataFrames[[i]] <- data.frame(a=sample(letters, 500, rep=T),
b=rnorm(500), c=rnorm(500))}我目前使用的是: df <- do.call("rbind", listOfDataFrames)
3 回答

慕慕森
TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超17個(gè)贊
bind_rows(list_of_dataframes, .id = "column_label")
- 3 回答
- 0 關(guān)注
- 587 瀏覽
添加回答
舉報(bào)
0/150
提交
取消