I have a large data frame where the percentages are written as 10% and not .1. Not all columns are percentage, but quite a few are.
Is there an elegant way to convert all % into decimals? I'm especially concerned where percentages might be greater than 100% and that the rule can be applied to the entire tibble instead of me having to figure out which columns to target.
Example if not clear... this:
tibble(cola = c("hello", "good bye", "hi there"), colb = c("10%", "20%", "100%"), colc = c(53, 67, 89),cold = c("10%", "200%", "50%") )
to this:
tibble(cola = c("hello", "good bye", "hi there"), colb = c(.10, .20, 1.0), colc = c(53, 67, 89),cold = c(.10, 2.0, .5) )
Thanks.