[R] S4method with special character

Droit Arnaud Arnaud.Droit at ircm.qc.ca
Mon Nov 23 22:14:06 CET 2009


Hi everyone,

I've set some method "[", "|", "&", etc.. to work with specific S4 object.

So now, I'm trying to comment this functions in a Rd file.
Usual functions are describe as :
 \S4method{length}{motiv}(x) where "motiv" is my S4 object taking an argument x.

Unfortunatly,   \S4method{[}{motiv}(x) generates an error when using the check function :
Bad \usage lines found in documentation object 'motiv-methods':
       <unescaped bksl>S4method{]}{motiv}(x)
Functions with \usage entries need to have the appropriate \alias entries,
and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See the chapter 'Writing R documentation files' in manual 'Writing R

The "[" character seems to be not allowed in the description of the S4method. \[ does not change anything.

Is there a way to use special character ([, &, |, ...) in the description of S4method ?

Thanks.

Arnaud Droit.




More information about the R-help mailing list