title: R: Transform multiple variables to ordered factors using same ifelse condition
body: <p>I am trying to transform four character variables in <a href="https://dl.dropboxusercontent.com/u/1791181/ifelse.csv" rel="nofollow">this dataset</a> into ordered factors. The logic I am trying to apply is shown for the variable "A" below:</p>
  
  <pre><code>df$A = factor(ifelse(df$A %in% c('NOT CONDUCTED AT ALL','RARELY'),'L1',
                                ifelse(df$A == 'OCCASIONALLY', 'L2',
                                       ifelse(df$A == 'QUITE FREQUENTLY', 'L3', 'L4'))))
  df$A = ordered(factor(df$A), levels=c('L1','L2','L3','L4'))
  </code></pre>
  
  <p>Is there a way to transform <em>all</em> the variables in one shot using the same condition?</p>