renkun-ken / pipeR

Multi-Paradigm Pipeline Implementation
Other
169 stars 39 forks source link

Add the feature of composing functions #1

Closed renkun-ken closed 10 years ago

renkun-ken commented 10 years ago

Composing functions should be allowed.

logdiff <- log %>% diff
lgplot <- log %>% diff %>% plot(col="red")
lgplot2 <- (function(x) x^2) %>% log %>% diff %>>% plot(.,col="red")
renkun-ken commented 10 years ago

No need to compose functions in this way, just use a function definition to store a common piping procedure.

procedure1 <- function(data) {
  data %>% log %>% diff %>% plot(col="red")
}