In some computing subcultures, the term "grapes" refers to the percent sign, which R uses to name binary operators such as %*%
. Here, grapes
is an R package that turns arbitrary functions into binary operators. As with the magrittr pipe, this allows you to avoid cumbersome parentheses in your code.
library(grapes)
grow(rbind, c, from = "base") # Use `from` to specify a package or environment to search.
bunch() # see the operators (grapes you have grown)
nrow(sleep) # 20
longer = sleep %rbind% sleep %rbind% sleep # No clumsy parentheses!
nrow(longer) # 60. Most of us would like to sleep longer.
1 %rbind% 2 %c% 3
To install the development version, get the devtools package and run
devtools::install_github("wlandau/grapes", build = TRUE)
If you specify a tag, you can install a GitHub release.
devtools::install_github("wlandau/grapes@v1.0.0", build = TRUE)
The online package vignette has a complete tutorial. You can load the compiled version from an R session.
vignette("grapes")
Please read the issue tracker first, taking care to browse both open and closed issues. Afterwards, if you still feel the need, submit a new issue to log a bug report or feature request.