title: Fill values in one vector conditioned on values in another vector
body: <p>I have two data frames with two different dimensions :</p>
  
  <p>1:</p>
  
  <pre><code>head(x)
     Year GDP_deflator
  1  1825           NA
  2  1826           NA
  3  1827           NA
  4  1828           NA
  5  1829           NA
  6  1829           NA
  7  1830           NA
  8  1830           NA
  9  1830           NA
  10 1831           NA
  
  dim(x)
    1733    2
  </code></pre>
  
  <p>2:</p>
  
  <pre><code>head(dataDef)
     Year GDP_deflator
  1  1825     1.788002
  2  1826     1.884325
  3  1827     2.016997
  4  1828     1.802907
  5  1829     1.781999
  6  1830     1.866437
  7  1831     1.960316
  8  1832     2.029601
  9  1833     1.880957
  10 1834     1.845750
  
  dim(dataDef)
   101   2
  </code></pre>
  
  <p>I would like to substitute values from <code>dataDef$GDP_deflator</code> column into <code>x$GDP_deflator</code> column conditioned on <code>Year</code> column. In other words, I would like the answer to be: </p>
  
  <pre><code>head (x)
  
     Year GDP_deflator
  1  1825           1.788002
  2  1826           1.884325
  3  1827           2.016997
  4  1828           1.802907
  5  1829           1.781999
  6  1829           1.781999
  7  1830           1.866437
  8  1830           1.866437
  9  1830           1.866437
  10 1831           1.960316
  </code></pre>
  
  <p>So the <code>repeating</code> years (i.e. 1830) get the same value, <code>1.866437</code>. Any suggestions?</p>
  
  <p>Best Regards</p>