Is it possible to supply logical (or arithmetic) operators as arguments to R functions. Check this SO question that share the theme.
f1 <- function(a, b) a>b
Then
> f1(1,2)
[1] FALSE
How can I implement an operator that allows me to for instance change the function test, e.g.
f2 <- function(a, b, operator = c('<', '>', '==')) { ... }
Then I would like
> f2(1, 2, '<')
[1] TRUE