在R包中记录特殊(中缀)功能 [英] Documenting special (infix) functions in R packages
问题描述
在先前的帖子中,我询问了有关声明此类功能的问题在R包中并使它们工作.成功之后,我现在正在尝试记录一个这样的功能.
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.
我创建了一个以函数名称作为标题的Rd
文件,但是在运行CHECK
时,出现以下警告:
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%'
我尝试了几个名称,例如%IN%.Rd
或'%IN%'.Rd
,但无济于事.关于如何进行这项工作的任何提示?
I tried several names such as %IN%.Rd
or '%IN%'.Rd
, to no avail. Any hints on how to make this work?
推荐答案
goto指南肯定是第2.1.1节文档功能" \alias的使用.根据编写R扩展名"手册,必须至少在\alias
和文本中对%
进行转义.关于\name
,它指出:"[名称不应该包含]'!''|'或'@',为避免HTML帮助系统可能出现的问题,它不应该包含'/'或空格.(LaTeX特殊字符是允许的,但可能无法在索引中正确整理.)" [2] 和大约\alias
:百分号和左大括号需要转义.
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]
这篇关于在R包中记录特殊(中缀)功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!