title: Batch convert columns to numeric type
body: <p>I have a dataframe with a bunch of columns that I need to convert to the numeric type. I have written the following code to try to do this, however it is saying the replacement has 0 rows.</p>
  
  <pre><code>instanceconvert &lt;- colnames(regmodel[7:262])
  
  for (i in instanceconvert)
  {
    regmodel$i &lt;- as.numeric(regmodel$i)
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>