Adding data to column dependent on match
merge, r, union
Solution
You're looking for
rbind(df1, df2)
X Y
1 aap 500
2 rel 12
3 kop 350
4 lee 100
5 1su 12
6 eeu 350
7 ggu 80
8 ees 50
Problem
I am trying to merge data from one dataframe to another. I suppose this is an easy question for everybody here. But I cant seem to get the right result. So something like. ``` df1 <- data.frame(X=c("aap","rel","kop"), Y=c(500,12,350)) df2 <- data.frame(X=c("lee","1su","eeu","ggu", "ees"), Y=c(100,12,350,80,50)) df3 <- merge(df1, df2) ``` The result should be: ``` df3 <- data.frame(X=c("aap","rel","kop", "lee","1su","eeu","ggu", "ees"), Y=c(500,12,350,100,12,350,80,50) ```