title: Recherche value in other dataframe for computation
body: <p>I have a df that looks like that: </p>
  
  <pre><code>df1 &lt;- data.frame(country = c("C1","C1","C2","C2"),year = c(1998,2001,1998,2001), amount = c(11000,11500,5000,4100))
  </code></pre>
  
  <p>I created another df based on the first one as follow:</p>
  
  <pre><code>df2 &lt;- aggregate(amount ~ year, df1, sum)
  </code></pre>
  
  <p>I would to create a new column <code>df1$ratio</code> corresponding to the amount ration of each ID for each year. it should look like: </p>
  
  <pre><code>df3 &lt;- data.frame(country = c("C1","C1","C2","C2"),year = c(1998,2001,1998,2001), amount = c(11000,11500,5000,4100), ratio = c(.6875, .7372,.3125,.2628))
  </code></pre>
  
  <p>Any Idea? </p>