Declaring special (infix) functions in R packages

爷,独闯天下 提交于 2019-12-20 03:41:19

问题


I am writing a package containing a function such as:

"%IN%" <- function(x, table) x & match(x, table, nomatch = 0) > 0

When I Build & Reload the package (I use RStudio), this function is not available, as opposed to all other functions defined in the package.

How do I make this work?


回答1:


The solution entails installing roxygen2 and modifying the NAMESPACE file to include a line such as:

export("%IN%")


来源:https://stackoverflow.com/questions/24660864/declaring-special-infix-functions-in-r-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!