I am trying to chain several methods (defined in reference class system) from the form of
Object_2 <- Object_1$first_method(para_a)
Object_3 <- Object_2$second_method(para_b)
into, like
Object_3 <- Object_1$first_method(para_a) %>% second_method(para_b)
But this does not work and I got an error of
could not find function
I tried the operator %$%
, turns out that it works for fields in an object but not for a method.
So, I'd like to ask how to do what I want in a pipeline?