-->

Documenting special (infix) functions in R package

2019-08-07 09:50发布

问题:

In an earlier post, I asked about declaring such functions in R packages and making them work. Having succeeded, I'm now trying to document one such function.

I created an Rd file with the function's name as a title, but when running the CHECK, I get the following warning:

* checking for missing documentation entries ... WARNING
Undocumented code objects:
  '%IN%'

I tried several names such as %IN%.Rd or '%IN%'.Rd, to no avail. Any hints on how to make this work?

回答1:

The goto guide would definitely be section 2.1.1 "Documenting functions"[1] of the "Writing R Extensions" manual. As @joran pointed out in a comment the important part maybe the use of an \alias. According to the "Writing R extensions" manual the %s need to be escaped at least in \alias and in the text. About \name it states: " [name should not contain] ‘!’ ‘|’ nor ‘@’, and to avoid possible problems with the HTML help system it should not contain ‘/’ nor a space. (LaTeX special characters are allowed, but may not be collated correctly in the index.)"[2] and about \alias: " Percent and left brace need to be escaped by a backslash."[3]