[R] Problem with % in an example when running R CMD check
Peter Langfelder
peter.langfelder at gmail.com
Tue May 31 23:12:38 CEST 2011
I observed the same behaviour some time ago. The .Rd files are
pre-processed using a latex-like typesetter that discards everything
following a % sign as comments, even in example R code.
http://r.789695.n4.nabble.com/Rd-file-processing-suggestion-sign-in-examples-td3459570.html
HTH,
Peter
On Tue, May 31, 2011 at 2:08 PM, Frank Harrell <f.harrell at vanderbilt.edu> wrote:
> Using
>
> platform x86_64-pc-linux-gnu
> arch x86_64
> os linux-gnu
> system x86_64, linux-gnu
> status
> major 2
> minor 13.0
> year 2011
> month 04
> day 13
> svn rev 55427
> language R
> version.string R version 2.13.0 (2011-04-13)
>
> I am getting an error I haven't seen before when running R CMD check on a
> package:
>
> Warning: parse error in file 'rms-Ex.R':
> 14: unexpected symbol
> 376: f <- ols(y ~ pol(x1,2) + pol(x2,2) + pol(x1,2)
> 377: subset
> ^
> The original (quote old) code in an 'example' section of an .Rd file is:
>
> f <- ols(y ~ pol(x1,2) + pol(x2,2) + pol(x1,2) %ia% pol(x2,2),
> subset=group==g)
>
> Putting \ before the % gets around the problem but I didn't have to do that
> before.
>
> Any ideas?
> Thanks Frank
>
>
> -----
> Frank Harrell
> Department of Biostatistics, Vanderbilt University
> --
More information about the R-help
mailing list