Remove pattern from string with gsub
Alternatively, you can also try:
gsub("\\S+_", "", a)
The following code works on your example :
gsub(".*_", "", a)
Alternatively, you can also try:
gsub("\\S+_", "", a)
The following code works on your example :
gsub(".*_", "", a)