Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
、、およびその他のようなスマート は必要ありません。rbindrbindlistrbind.fillbind_row
rbind
rbindlist
rbind.fill
bind_row
rbind2つのデータフレームを単純にバインドするには、ダムが必要です:
> a <- data.frame(a = 1:3) > b <- data.frame(b = 1:2) > some.magic.bind(a, b) # what function to use here? a b 1 1 1 2 2 2 3 3 NA
あなたはしたくcbindないrbind。
cbind
試す :
a = c(1:3) b = c(1:2) length(b) = length(a) cbind(a, b)
mergedata.frame長さの異なる2 つの に直接作用し、それを として保持しますdata.frame:
merge
data.frame
merge(a,b,by="row.names",all.x=TRUE)[,-1] a b 1 1 1 2 2 2 3 3 NA