title: several substitutions in one line R
body: <p>I have a column in a dataframe in R with values "-1","0","1".  I'd like to replace these values with "no", "maybe" and "yes" respectively.  I'll do this by using sub.</p>
  
  <p>I could write a conditional function, and then code:</p>
  
  <pre><code>    df[col] &lt;- lapply(df[col], conditional_function_substitution)
  </code></pre>
  
  <p>I could also do the substitutions one at a time (example of first of three):</p>
  
  <pre><code>   df[col] &lt;- lapply(df[col], sub, pattern = '-1', replacement = "no")
  </code></pre>
  
  <p>I'm wondering if it can be done in one line?  Something like:</p>
  
  <pre><code>   df[col] &lt;- lapply(df[col], sub, pattern = c('-1','0','1'), replacement = c('no','maybe','yes')
  </code></pre>
  
  <p>Thanks for your insight!</p>