[R] removing a word, the following space and the next word

Rolf Turner r.turner at auckland.ac.nz
Sun Sep 21 22:39:44 CEST 2008


On 21/09/2008, at 5:15 AM, jim holtman wrote:

>> x <- 'Mr Jones ate lunch and Mr Smith was tied'
>> gsub('(Mr\\.*)\\s+\\w+', "\\1 <file://0.0.0.1/> xxxx", x)
> [1] "Mr xxxx ate lunch and Mr xxxx was tied"

I don't get what the bit

	<file://0.0.0.1/>

is about.  If I do (just)

	gsub('(Mr\\.*)\\s+\\w+', "\\1 xxxx", x)

I get the desired result, i.e.


[1] "Mr xxxx ate lunch and Mr xxxx was tied"

	cheers,

		Rolf Turner


	

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list