title: R How can I replace values with values of another dataframe?
body: <p>I have a huge dataframe <em>df</em> containing Numbers in the column "a" I also have a dataFrame <em>name</em> that contains the names corresponding to these numbers. </p>
  
  <pre><code>df:                          
   a   b     c                   name:
   1   val1  val2                  1  cat
   1   val1  val2                  2  dog
   2   val1  val2                  3  rabbit
   3   val1  val2
   3   val1  val2
   3   val1  val2
  </code></pre>
  
  <p>Now I want to replace the numbers with the names. The new dataFrame should look like this:</p>
  
  <pre><code>df:                                      
     a        b     c      
     cat      val1  val2                  
     cat      val1  val2                  
     dog      val1  val2                  
     rabbit   val1  val2
     rabbit   val1  val2
     rabbit   val1  val2
  </code></pre>
  
  <p>I realized this like that. It works but I am not content, because I hardCode the names ...</p>
  
  <pre><code>  df$a&lt;-replace(df$a, df$a==1, "cat" )
    df$a&lt;-replace(df$a, df$a==2, "dog" )
    df$a&lt;-replace(df$a, df$a==3, "rabbit" )
  </code></pre>
  
  <p>How can I get the new values out of my dataframe name ?</p>
  
  <p>Thank you!</p>