I run into a problem when converting character of percentage to numeric. E.g. I want to convert \"10%\" into 10%, but
as.numeric(\"10%\")
r
Remove the "%", convert to numeric, then divide by 100.
"%"
x <- c("10%","5%") as.numeric(sub("%","",x))/100 # [1] 0.10 0.05