parse_number
has been the perfect function for when I am parsing html tables that have columns formatted with "%". Very often, I want to use parse_number
and convert to a decimal in one whole operation. I know there are alternate ways to parse the function without using parse-number
, but does parse_number
have a way to do what I'm looking for built into the function? Otherwise, most of my mutate_at
commands end up getting run in two separate operations.
Sample code below:
library(readr)
x <- "10.5%"
parsed <- parse_number(x)
parsed_decimal <- parsed / 100