Adding data to a column based on compliance

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) 
+4
source share
1 answer

You are 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
+5
source

All Articles