[R] escape character OK in R environment, fails in R CMD CHECK
ligges at statistik.tu-dortmund.de
Sat May 22 16:07:29 CEST 2010
On 22.05.2010 08:18, Henrik Bengtsson wrote:
> R version/sessionInfo()?
> On Fri, May 21, 2010 at 10:08 PM, David Reiss<dreiss at systemsbiology.org> wrote:
>> I am trying to check a package via R CMD CHECK and it is failing with
>> Error: '\s' is an unrecognized escape in character string starting "\s"
>> The culprit looks something like this:
>> gsub('\\s\\(.*\\)',"","this is a (test, man) dude")
I guess this is in the Examples of an Rd document, right? If so, you
need to double escape, i.e.:
gsub('\\\\s\\\\(.*\\\\)',"","this is a (test, man) dude")
>> which is correctly escaped with the "\\"'s -- but it seems that R CMD
>> CHECK is pre-escaping the string when it reads in the code to check it.
>> How do I get R CMD CHECK to let the "\\s" 's through?
>> [[alternative HTML version deleted]]
>> 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.
> 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.
More information about the R-help