can anyone show me how to get such a function working:
library(tidyverse)
## Testing Data:
dat <- tibble(without_space=rep(c(0,1),5), `with space`=rep(c(1,0),5))
## Some custom function containing filter:
custom_filter <- function(data, column, value){
return(filter_(data, column==value))
}
## Expected Output:
filter(dat, `with space`==0)
## Function Call:
custom_filter(dat, `with space`, 0)
I read some stuff about Standard and Non-standard evaluation and played around with as.name()
, quote()
and so on, but could not get it working.
Thanks for helping!