I am trying to separate values (all numbers) and value labels (mix of numbers and characters) in separate vectors with the goal of ordering and labelling a factor variable.
Vector:
text <- "1 = Less than 1 month; 2 = 1 to 3 months; 3 = More than 4 months, less than 1 year"
Output:
numbers <- c("1", "2", "3")
characters <- c("Less than 1 month", "1 to 3 months", "More than 4 months, less than 1 year")