Last active
August 18, 2016 11:22
-
-
Save cosi1/da5c5e8fb256536b8e3a2277d5b3f24d to your computer and use it in GitHub Desktop.
Minimalist pipe operator for R
This file contains hidden or 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
| `%>%` = function(par, fun) { | |
| s = substitute(fun) | |
| fun.name = s[[1]] | |
| fun.args = as.list(s) | |
| fun.args[[1]] = par | |
| do.call(deparse(fun.name), fun.args) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment