I have a vector of character data. Most of the elements in the vector consist of one or more letters followed by one or more numbers. I wish to split each element in the
Since none of the previous answers use tidyr::separate here it goes:
tidyr::separate
library(tidyr) df <- data.frame(mycol = c("APPLE348744", "BANANA77845", "OATS2647892", "EGG98586456")) df %>% separate(mycol, into = c("text", "num"), sep = "(?<=[A-Za-z])(?=[0-9])" )