Last active
August 29, 2015 14:08
-
-
Save renkun-ken/7060debc32cce49dc57d to your computer and use it in GitHub Desktop.
simpler pipeR_world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by the amazing idea of hoxo_m | |
# see http://qiita.com/hoxo_m/items/3fd3d2520fa014a248cb | |
# shocked even if you don't understand Japanese! | |
pipes <- function(expr) { | |
expr <- substitute(expr) | |
pipe_expr <- if(expr == "{") { | |
Reduce(function(pl, p) as.call(list(quote(`%>>%`), pl, p)), expr[-1L]) | |
} else expr | |
eval(pipe_expr, envir = parent.frame()) | |
} |
Author
renkun-ken
commented
Oct 31, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment