# NOT RUN {
data(twoFiles)
n1 <- nrow(df1)
## the true matches
cbind( df1[df2ID[df2ID<=n1],], df2[df2ID<=n1,] )
## alternatively
df1$ID <- 1:n1
df2$ID <- df2ID
merge(df1, df2, by="ID")
## all the records in a merged file
merge(df1, df2, by="ID", all=TRUE)
# }
Run the code above in your browser using DataLab