> On 23 Aug 2017, at 07:45, Rolf Turner <r.tur...@auckland.ac.nz> wrote: > > My reading of ?regex led me to believe that > > gsub("[:alpha:]","",x) > > should give the result that I want.
That's looking for any of the characters a, l, p, h, : . What you meant to say was gsub("[[:alpha:]]","",x) i.e. the character class [:alpha:] within a character set. Best, Stefan ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.