Let's say I have this data frame:
df <- as.data.frame(c("77111","77039","5005","4032"))
and I want to create a new column where if the values start with "77", then remove the "77" and extract the remaining numbers. Otherwise, keep the values as is so that the new column looks like this:
df <- df %>% mutate(new_numbers =c("111","039","5005","4032"))