Konrad Konrad - 8 months ago 41
R Question

Calling a special function from within namespace

I'm interested in calling a special function from a namespace without the need to load the package. For instance, as described on R-bloggers, the package

developed by Peter Solymos offers a convenient function
. The function is of a simple syntax:

"%notin%" <- function(x, table) !(match(x, table, nomatch = 0) > 0)


I would like to make use of this function without the need load the package. The attempted :

Attempt 1

1:10 mefa4::`%notin%` 7:10

results in an error:

Error: unexpected symbol in "1:10 mefa4"
In addition: Warning message:
package ‘sp’ was built under R version 3.3.2

Attempt 2

mefa4::`%notin%` c(7:10, 1:10)


Error: unexpected symbol in "mefa4::'%notin%' c"

Answer Source

You can call the function using:

mefa4::`%notin%`(7:10, 1:10)