title: Overwrite levels of factor columns in one dataframe using another
body: <p>I have 2 data frames with multiple factor columns. One is the base data frame and the other is the final data frame. I want to update the levels of the base data frame using the final data frame.</p>
  
  <p>Consider this example:</p>
  
  <pre><code>base &lt;- data.frame(product=c("Business Call", "Business Transactional", 
                               "Monthly Non-Compounding and Standard Non-Compounding",
                               "OCR based Call", "Offsale Call", "Offsale Savings",
                               "Offsale Transactional", "Out of Scope","Personal Call"))
  base$product &lt;- as.factor(base$product)
  
  final &lt;- data.frame(product=c("Business Call", "Business Transactional", 
                                "Monthly Standard Non-Compounding", "OCR based Call", 
                                "Offsale Call", "Offsale Savings","Offsale Transactional", 
                                "Out of Scope","Personal Call", "You Money")) 
  final$product &lt;- as.factor(final$product)
  </code></pre>
  
  <p>What I would now want is for the final data base to have the same levels as base and remove the levels which do not exist at all like "You Money". Whereas "Monthly Standard Non-Compounding" to be fuzzy matched</p>
  
  <p>Eg:</p>
  
  <pre><code>levels(base$var1) &lt;- "a" "b" "c"
  levels(final$var1) &lt;- "Aa" "Bb" "Cc"
  </code></pre>
  
  <p>Is there a way to overwrite the levels in base data using the final data using some kind of fuzzy match?</p>
  
  <p>Like I want the final levels for both data to be the same. i.e.</p>
  
  <pre><code>levels(base$var1) &lt;- "Aa" "Bb" "Cc"
  levels(final$var1) &lt;- "Aa" "Bb" "Cc"
  </code></pre>