Matching elements of two data frames in R
<p>I have two data frames. The first looks like this</p>

<pre><code>  name
1  a 
2  b 
3  c 
4  d 
5  f 
</code></pre>

<p>and the second like this </p>

<pre><code>    name   value
1    b       3
2    d       4
3    f       5
4    a       1
5    c       2
6    k       7
7    m       6
</code></pre>

<p>Now I want to add a second column to the first data frame which contains the values of elements taken from the second list. It has to look like this</p>

<pre><code>       name  value
    1   a      1
    2   b      3 
    3   c      2
    4   d      4
    5   f      5
</code></pre>

<p>Can somebody help me this? </p>