Skip to content
Prev 21573 / 63424 Next

% symbol in .Rd files?

Martin Maechler wrote:
An example of the '% problem' is provided by the RcppExample.Rd file that
is part of the RcppTemplate package (V4.2). There you will find:

# Note that we need to escape the percent sign here...
datestr <- c('2006-6-10', '2006-7-12', '2006-8-10')
datevec <- as.Date(datestr, "\%Y-\%m-\%d") # date vector

Without the escaped '%' signs I get an obscure error message when
I run:
 > example(RcppExample)

Here is the error message:
Error in parse(file, n = -1, NULL, "?") : syntax error at
36:
 
37:
 >

There was another problem with this package (now fixed) that
was showing up on CRAN, but not in my testing. This was due to
the fact that the latest version of r-devel includes some new
type checking, so an error was caught at CRAN, but not in
my testing (I use the standard version of R). This problem was
unrelated to the '% problem'.


ds