title: How to call the value that contains a column using the value of a field from another dataframe
body: <p>I am trying to move the value of each year from <code>df_2</code> to <code>df_1</code>. </p>
  
  <pre><code>countries &lt;- c("USA","Canada","Denmark","Albania", "Turkey","France", "Italy")
  values &lt;- c(100, 1000, 300, 300,7000, 8343,9211)
  year &lt;- c(2007,2008,2009,2008,2008,2009,2008)
  df_1 &lt;- data.frame(countries, values, stringsAsFactors = FALSE)
  
  countries &lt;- c("USA","Canada","Denmark","Albania", "Turkey","France", "Italy")
  `2007` &lt;- c(2,3,5,6,7,8,8)
  `2008` &lt;- c(23,23,65,86,97,98,68)
  `2009` &lt;- c(12,33,35,46,67,78,88)
  
  df_2 &lt;- data.frame(countries, `2007`, `2008`, `2009`, stringsAsFactors = FALSE)
  </code></pre>
  
  <p>Mi idea about how to solve this:</p>
  
  <pre><code>df_1 &lt;- dplyr::mutate(df_1, ifelse((df_1$country == df_2$country), df_2$(df_1$year), 0)
  </code></pre>
  
  <p>The expected result is this a new column contain the values from each year and country:</p>
  
  <pre><code>df_1$value_that_year &lt;- c(2,23,35,86,97,78,68)
  </code></pre>