Declaring special (infix) functions in R packages

2020-03-26 07:33发布

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条回答
beautiful°
2楼-- · 2020-03-26 07:51

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

export("%IN%")
查看更多
登录 后发表回答