title: recode multiple variables with missing levels
body: <p>I have a data frame with many columns of integer variables, each representing a particular question on a food frequency questionnaire. I want to recode these columns to numerical variables representing the number of servings of that food eaten per month. <code>mapvalues()</code> in <code>plyr</code> seems like the right function, but I keep getting warning messages because not all of the foods have the full range of responses recorded:</p>
  
  <pre><code>The following `from` values were not present in `x`: 4, 5, 6, 7, 8
  </code></pre>
  
  <p>Setting <code>warn_missing = false</code> does not return warning messages, but my data are still not being recoded.</p>
  
  <p>Sample code (nails is my data frame, and foodnames is a list of variable names):</p>
  
  <pre><code>for (food in foodnames[c(7:81, 95:97)]){
    mapvalues(eval(parse(text=paste("nails$", food))), from = c(1:8),
              to = c(0, 1, 2.5, 4, 8, 14, 22, 28)), warn_missing = FALSE)
  }
  </code></pre>
  
  <p>How can I get R to recode these variables even if they do not contain all the integers from 1 to 8? Thanks in advance.</p>