title: How to use mapvalues() function to transform integer variables into factor variables?
body: <p>How to use mapvalues() function to perform the below operation (converting integer variable into factor variable)?</p>
  
  <pre><code>library(MASS)
  data(birthwt)
  birthwt&lt;-birthwt %&gt;% mutate(low=as.factor(low),race=as.factor(race),smoke=as.factor(smoke),ptl=as.factor(ptl),ht=as.factor(ht),ui=as.factor(ui),ftv=as.factor(ftv))
  </code></pre>