I have two data frames with two different dimensions :
1:
head(x) Year GDP_deflator 1 1825 NA 2 1826 NA 3 1827 NA 4
You want to merge the two data.frames. It's a many-to-one merge.
merge
One possibility is to use match:
match
x$GDP_deflator <- dataDef$GDP_deflator[match(x$Year, dataDef$Year)]