I am trying to combine data from one data block into another. I guess this is a simple question for everyone here. But I can’t get the right result. So something like that.
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)
source
share