I often have to bulk convert a set of columns, some of which are of character type, while the others are double. When I try to use the parse_number() function I get:
Caused by error in `parse_vector()`:
! variable is.character(x) is not TRUE
It would be really handy if I could set something like ignore_numbers = TRUE for the function to just return the numeric column unchanged.
A simple use case would be if I wanted to convert multiple columns with analogous names without bothering about some of them already being numeric:
I often have to bulk convert a set of columns, some of which are of
character
type, while the others aredouble
. When I try to use theparse_number()
function I get:It would be really handy if I could set something like
ignore_numbers = TRUE
for the function to just return the numeric column unchanged.A simple use case would be if I wanted to convert multiple columns with analogous names without bothering about some of them already being numeric:
A workaround would be: