r compare values two columns code example
Example 1: compare two string in R
library(stringi)
stri_reverse("madam")
## [1] "madam"
stri_reverse("sir")
## [1] "ris"
Example 2: r merge by two columns
x <- data.frame(k1=c(NA,NA,3,4,5), k2=c(1,NA,NA,4,5), data=1:5)
y <- data.frame(k1=c(NA,2,NA,4,5), k2=c(NA,NA,3,4,5), data=1:5)
merge(x, y, by=c("k1","k2"))