Skip to content

wlandau/grapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis-CI Build Status AppVeyor Build Status codecov.io CRAN_Status_Badge

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

Installation

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)

Tutorial

The online package vignette has a complete tutorial. You can load the compiled version from an R session.

vignette("grapes")

Help and troubleshooting

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.

About

Turn R functions into binary operators.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages