-->

Declaring special (infix) functions in R packages

2020-03-26 07:26发布

问题:

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%")