title: Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
body: <p>Complicated title but here is a simple example of what I am trying to achieve:</p>
  
  <pre><code>d &lt;- data.frame(v1 = c(1,2,3,4,5,6,7,8), 
                  v2 = c("A","E","C","B","B","C","A","E"))
  
  m &lt;- data.frame(v3 = c("D","E","A","C","D","B"), 
                  v4 = c("d","e","a","c","d","b"))
  </code></pre>
  
  <p>Values in <code>d$v2</code> should be replaced by values in <code>m$v4</code> by matching the values from <code>d$v2</code> in <code>m$v3</code></p>
  
  <p>The resulting data frame <code>d</code> should look like:</p>
  
  <pre><code>v1    v4
  1      a
  2      e
  3      c
  4      b
  5      b
  6      c
  7      a
  8      e
  </code></pre>
  
  <p>I tried different stuff and the closest I came was: <code>d$v2 &lt;- m$v4[which(m$v3 %in% d$v2)]</code></p>
  
  <p>I try to avoid any for-loops again! Must be possible :-) somehow... ;)</p>