Re: [R] gsub does not support \b?

2009-11-11 Thread Uwe Ligges



Tan, Richard wrote:

Hello, can someone help?  How come
 

gsub(\bINDS\b,INDUSTRIES,ADVANCED ENERGY INDS)

[1] ADVANCED ENERGY INDS



It does, but you need to escape it:

 gsub(\\bINDS\\b,INDUSTRIES,ADVANCED ENERGY INDS)

Uwe Ligges





not ADVANCED ENERGY INDUSTRIES
 
Thanks.

Richard

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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.


__
R-help@r-project.org mailing list
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.


[R] gsub does not support \b?

2009-11-10 Thread Tan, Richard
Hello, can someone help?  How come
 
 gsub(\bINDS\b,INDUSTRIES,ADVANCED ENERGY INDS)
[1] ADVANCED ENERGY INDS
 
not ADVANCED ENERGY INDUSTRIES
 
Thanks.
Richard

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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.


Re: [R] gsub does not support \b?

2009-11-10 Thread Tan, Richard
Ok, I figured it out.  My stupid mistake, should be \\b instead of \b.



From: Tan, Richard 
Sent: Tuesday, November 10, 2009 3:36 PM
To: 'r-help@r-project.org'
Subject: gsub does not support \b?


Hello, can someone help?  How come

 gsub(\bINDS\b,INDUSTRIES,ADVANCED ENERGY INDS)
[1] ADVANCED ENERGY INDS

not ADVANCED ENERGY INDUSTRIES

Thanks.
Richard

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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.