I have two data frames: "bim2"
and "illum".
If V2 of bim2 match with illum V1 (match(bim2$V2, illum$V1)
), I want to replace bim$V2
with the value in illum$V2
. If it doesn't match (bim2$V2
not equal to illum$V1
), I want to keep the original values in bim$V2
.
I've used
bim2$V2 <- illum$V2[match(bim2$V2, illum$V1)]
but it replaces the "bim2$V2
not equal to illum$V1
" by NAs.