title: Replacing character string with another character string
body: <p>I have a data frame for which I am attempting to replace certain values with others. So, as a small example, I have a dummy data frame of:</p>
  
  <pre><code>dummy&lt;-c("1","2","3","4")
  dummy&lt;-data.frame(dummy)
  dummy$dummy&lt;-as.character(dummy$dummy)
  
  odd&lt;-c("1","3")
  
  replace(dummy$dummy, dummy$dummy==odd, "odd")
  
  #&gt; [1] "odd" "2"   "3"   "4" 
  </code></pre>
  
  <p>Why would this only replace "1" with "odd" and not "3"?</p>
  
  <p>My actual dataset has more information in it (it is restaurant cuisine types and I need to replace the types of cuisine by a more general category. For example, I have the cuisine types "Italian" and "French" in my dataset that need to be replaced with "European", and cuisine types "Southwestern" and "Pacific Northwestern" that need to be replaced with "American".</p>
  
  <p>Is the above idea the most efficient way to do this? </p>