title: Convert selected dataframe column to another class
body: <p>I would like to add a vector of character class to a dataframe without affecting the type of class of the other columns.
  For example, the dataframe mtcars consists only of numeric types of columns and if I add an additional column like this,</p>
  
  <pre><code>m &lt;- mtcars
  col &lt;- rownames(mtcars)
  m &lt;- data.frame(m, col)
  </code></pre>
  
  <p>then all the original numeric classes of columns are converted to character class. Why is this happening? Is there a way to avoid this? And let's say I don't mind converting each columns back to their respective classes after the addition of the column <code>col</code>, how would I do that?</p>
  
  <p><img src="https://i.stack.imgur.com/6rWcP.jpg" alt="enter image description here"></p>