1
儘管複雜的標題應用分類,給一個變量,我想做的事情很簡單:試圖在一個數據幀中的另一個數據幀
如果我有兩個dataframes:
d <- data.frame(V1 = c("a","b","c","d"), V2 = c("P", "M", "M", "P"))
j <- data.frame(V3 = c("d","b","b","c","d","c", "a"))
和我要插入另一列到數據幀Ĵ,稱爲V4其分配同一分類中的d,即最終的數據框的樣子:
j
V3 V4
d P
b M
b M
c M
d P
c M
a P
太感謝你了! – demsav