Closed DroiPlatform closed 4 years ago
They are not equivalent. FunIt
accepts a single argument, y
, yet you pass it two: x
(via the pipe) and ff
. So not working is the correct behavior.
So these variations of your example will work:
ff <- function(x) { mean(x) > 10 }
FunIt <- function(y) { Filter(y, f=f2(ff)) }
x %>% FunIt
or
ff <- function(x) { mean(x) > 10 }
FunIt <- function(y, f) { Filter(y, f=f2(f)) }
x %>% FunIt(ff)
Please take a look at the following code. Version 5 should be equivalent to version 6 But only v5 works. Not v6...