title: Match names from one file to ids from another in R
body: <p>I have two R data files (rda format), the first one is an edge list and contains only id numbers, the second one contains ids and names. I need to match the names from the second file to the ids in the first one, or just replace them. Which command should I use for that?</p>
  
  <p>Here is how the first file looks like:</p>
  
  <pre><code>one &lt;- data.frame(X1=c("id1","id1"),X2=c("id2","id3"))
  
      X1  X2
  1   id1 id2
  2   id1 id3
  </code></pre>
  
  <p>Here is the second one:</p>
  
  <pre><code>two &lt;- data.frame(User=c("g79","kian","greyracer"),ID=c("id1","id2","id3"))
  
      User      ID
  1   g79       id1
  2   kian      id2
  3   greyracer id3
  </code></pre>
  
  <p>Thanks in advance!</p>