I am trying to define the package for a specific function starting with %. For example let's take the %nin%
function from the Hmisc
package:
df1 <- "id name
1 one
2 two"
df1 <- read.table(text=df1, header=TRUE)
df2 <- "id name
3 three
2 two"
df2 <- read.table(text=df2, header=TRUE)
library(Hmisc)
df1[which(df1$id %nin% df2$id),]
Then specifying the package without loading it I get an error:
df1[which(df1$id Hmisc::%nin% df2$id),]
Error: unexpected symbol in "df1[which(df1$id Hmisc"
Any idea how to do it correctly?