[R] removing a word, the following space and the next word
A.Robinson at ms.unimelb.edu.au
Sat Sep 20 08:42:32 CEST 2008
I recommend doing some background reading on regular expressions
and using gsub().
On Sat, Sep 20, 2008 at 04:24:36PM +1000, Bob Green wrote:
> I am hoping for advice as to how I could remove all words immediately
> following the words 'Mr' or 'Mr.' in a csv file. For example, the
> following phrases are included in lines of text (along with other Mr)
> that could be anywhere in the file: "Mr Jones ate lunch" and "Mr
> Smith was tied".
> I want to remove the words Jones and Smith (etc) leaving the other
> text intact.
> Any suggestions are appreciated,
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Department of Mathematics and Statistics Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599
More information about the R-help