I'm using R to pull out numbers from strings of ids. In the past, I've used readr's parse_number() function, but recently, I'm getting a bizarre error where it's saying that my character column is not character:
library(dplyr)
library(readr)
test <- tibble(id_numbers = c("ICKLSD5", "DFTEM4", "DPDFE45"))
test %>%
parse_number(id_numbers)
Error in parse_vector(x, col_number(), na = na, locale = locale, trim_ws = trim_ws) :
is.character(x) is not TRUE
But, the column is clearly a character vector:
#Yields true
is.character(test$id_numbers)
And, even wrapping the column in as.character still gives the same error:
test %>%
parse_number(as.character(id_numbers))
I know there's other workarounds with other functions, but I really want to use parse_number(). Can anyone explain why I'm getting this error and how I can fix it?