In a dataframe that I read in from a csv file, there is a column of percent data that has % signs in it. Whats the best way to remove the %'s and change the variable class from "factor" to "numeric"?
The data look like this
What about trying the readr function readr::parse_number()? You'd have to first run the as.character() function to turn it from a factor to a character, and then parse_number to turn it into a number
A side-benefit of importing it with the readr function read_csv() in the first place (as opposed to the base read.csv()) is that it will automatically start with it as a character...although you could just add an argument to your read.csv() function of stringsAsFactors=FALSE