Skip to content

Instantly share code, notes, and snippets.

@cosi1
Last active August 18, 2016 11:22
Show Gist options
  • Save cosi1/da5c5e8fb256536b8e3a2277d5b3f24d to your computer and use it in GitHub Desktop.
Save cosi1/da5c5e8fb256536b8e3a2277d5b3f24d to your computer and use it in GitHub Desktop.
Minimalist pipe operator for R
`%>%` = 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