Escaping hyphen in S4 method in Rd usage section i

2019-08-15 08:46发布

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?

0条回答
登录 后发表回答