问题
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