Skip to content

Warnings about unrecognized escapes in Rd

5 messages · Peter Dalgaard, Seth Falcon, Brian Ripley

#
Hi,

The warning that was recently added to R-devel about unrecognized
escapes has been very helpful in identifying a number of incorrectly
specified regular expressions.

We are, however, seeing warning messages for Rd files that contiain
'\_' and I think that _is_ a recognized escape.

Can the check be refined so that '\_' is not warned about in Rd files?

+ seth
#
Seth Falcon <sfalcon at fhcrc.org> writes:
Er, do you have a minimal example showing the behaviour? It's not
quite clear whether you have this happening everywhere or only in
example sections, formulas or...?
#
Peter Dalgaard <p.dalgaard at biostat.ku.dk> writes:
Oups.  The example I was looking at has \_ in a number of places in
the Rd files so perhaps the warning is correct (in which case, my
apologies for the noise).

I'll look into it further.

Of course it would be easier to detect this if the warning message
gave more information about where the problem was encountered ;-)

+ seth
#
Seth Falcon <sfalcon at fhcrc.org> writes:
Just to complete the thread: I was wrong, R was warning about
unrecognized escape sequences in example and usage sections, not
documentation text.

Sorry for the noise.

+ seth
#
On Wed, 18 Oct 2006, Seth Falcon wrote:

            
This warning comes from the parser, and only when parsing quoted 
strings.  That is why it is hard to give any more information about where 
the error is: the parser does not know much about where in the input it 
is.  (You can't even easily give the current string as you are in the 
middle of parsing it: I am working on that one.)