how to feed the result of a pipe chain (magrittr) to an object

后端 未结 5 475
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 19:02

This is a fairly simply question. But I couldn\'t find the answer per google/stackexchange and looking at the documentation of magrittr. How do you feed the result of a chain of

5条回答
  •  天涯浪人
    2021-01-31 19:33

    Using pipeR's %>>% this should be very easy.

    library(pipeR)
    data.frame( x = c(1:3), y = (4:6)) %>>%
      sum %>>%
      (~ a)
    

    The pipeR tutorial may be helpful: http://renkun.me/pipeR-tutorial/ For assignment: http://renkun.me/pipeR-tutorial/Pipe-operator/Pipe-with-assignment.html

提交回复
热议问题