Remove numbers from alphanumeric characters

You can use gsub for this:

gsub('[[:digit:]]+', '', x)

or

gsub('[0-9]+', '', x)
# [1] "ACO"    "BCKDHB" "CD" 

Leave a Comment