I'm trying to pass in a conditional (<,>, etc) and a value into a function to be evaluated in a dplyr filter.
Other answers on SO suggest I should simply be able to use parse, but my sample function (without using the args) fails with:
Error in (...) & ~parse(text = "obj_200 > 0") : operations are possible only for numeric, logical or complex types
Sample function:
filterOrder = function( df, cond, value) {
df = df %>%
rownames_to_column('date') %>%
filter( ...
parse(text="obj_200 > 0"),
...
)
...
return(df)
}