[R] Eliminating numbers, period, and space from a string

Boris Steipe boris.steipe at utoronto.ca
Tue Apr 11 04:51:08 CEST 2017

Fie, knave, dost thou bid us do thine homework!

gsub("[^A-Za-z]", "", <string>)

> On Apr 10, 2017, at 7:11 PM, Olu Ola via R-help <r-help at r-project.org> wrote:
> Hello,I have a column of my data of the Following format
> 10. Arnold125. Jessica1. Romeo117. Juliet
> I need to eliminate the numbers, period, and the space before the names so that I have the following:
> ArnoldJessicaRomeoJuliet
> I tried using the gsub function but my code came up with errors.
> Any help will be appreciated.
> Thank you.
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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.

More information about the R-help mailing list