r function to convert factor colums into numeric column code example
Example 1: r dataframe convert factor to numeric
breast$class <- as.numeric(as.character(breast$class))
Example 2: r dataframe convert factor to numeric
breast[,'class'] <- as.numeric(as.character(breast[,'class']))