I wrote a method for a generic S4 function in R. The name of the generic function is extract
. The class the method refers to has a hyphen in it, as in Zelig-tobit
models. I'd like to write a documentation entry for the method as follows in the usage section of the respective .Rd file:
\S4method{extract}{Zelig-tobit}(model, ...)
If I do that, R CMD check --as-cran
returns an error message:
* checking Rd \usage sections ... WARNING
Bad \usage lines found in documentation object 'extract':
<unescaped bksl>S4method{extract}{Zelig-tobit}(model, ...)
How do I correctly escape the hyphen?
{"Zelig-tobit"}
, does this give a different error? – WaadtS4method
is grouped under...) – WaadtZelig_tobit
compile, at least? AndZeligtobit
– WaadtZelig-tobit
) and a general class name (i.e.,Zelig
). I am combining multiple extract methods in oneextract.Zelig
method and I'm using an if condition on the class name vector to determine which sub-model was estimated. While this works in my specific case, however, I would still be interested in a more general solution to this problem. That is, how can hyphens be escaped in usage sections of .Rd files? – Tarahtaran