我有這樣的事情:加入兩個列表中的R由ID
ids <- c("A","B","C")
ls <- list()
ls[[1]] <- c("aa","aaa")
ls[[2]] <- c("bb","bbb")
ls[[3]] <- c("cc","ccc")
,我想獲得的東西喜歡下:
data.frame(ids = c("A","A","B","B","C","C"), ls = c("aa","aaa","bb","bbb","cc","ccc"))
你會知道該怎麼辦呢? ls的每個元素的長度可能會有所不同,但ids和ls的長度是相同的。 Dplyr和purrr(tidyverse)是好的,我
最佳