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.
instanceconvert <- colnames(regmodel[7:262])
for (i in instanceconvert)
{
regmodel$i <- as.numeric(regmodel$i)
}
Any help would be appreciated.