マージ変数は、あなたが何をしているのか(とにかくだと思います)、以下のコードを見て、あなたが何をしているのかを確認できます。
# replicate data
countries <- c(rep("United States",4),rep("Canada",4))
dates <- c("1945","1946","1947","1948","1945","1946","1947","1948")
dates.country <- as.data.frame(cbind(countries,dates))
code.country <- as.data.frame(matrix(c("2","United States","20","Canada","31","Bahamas"),ncol=2, byrow = TRUE))
# set names for code.country
# variables to be merge on variable names must match
names(code.country) <- c("code","countries")
# this form of merge replicates what you want
combined.country <- merge(dates.country,code.country)
# there are a lot of options for merge so it is worth looking at
# ?merge to get and idea of what it can do. For example adding the
# all=TRUE flag will mean that all data is represented even if it
# is only in one dataset
combined.country.all <- merge(dates.country,code.country, all=TRUE)