SyntaxFix
Write A Post
Hire A Developer
Questions
Just to point out that there is an approach using functions from the tidyverse, which I find more readable than gsub:
tidyverse
gsub
a %>% stringr::str_remove(pattern = ".*_")