在R包中声明特殊(中缀)功能 [英] Declaring special (infix) functions in R packages
本文介绍了在R包中声明特殊(中缀)功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在写一个包含以下功能的软件包:
I am writing a package containing a function such as:
"%IN%" <- function(x, table) x & match(x, table, nomatch = 0) > 0
当我Build & Reload
软件包(我使用RStudio)时,此功能不可用,与软件包中定义的所有其他功能相反.
When I Build & Reload
the package (I use RStudio), this function is not available, as opposed to all other functions defined in the package.
我如何进行这项工作?
推荐答案
该解决方案需要安装roxygen2
并修改NAMESPACE
文件以包括以下行:
The solution entails installing roxygen2
and modifying the NAMESPACE
file to include a line such as:
export("%IN%")
这篇关于在R包中声明特殊(中缀)功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文