Converting data frame column from character to numeric
If we need only one column to be numeric But, if all the columns needs to changed to numeric, use lapply to loop over the columns and convert to numeric by first converting it to character class as the columns were factor. Both the columns in the OP’s post are factor because of the string “n/a”. This could be easily avoided while reading the file using na.strings = … Read more