grow: Function 'grow'

Description Usage Arguments Examples

View source: R/ui.R

Description

Turn a collection of functions into binary operators. For example, create the binary operator %cbind% from the function cbind() by calling grow(cbind). Then, you can call sleep %cbind% sleep %cbind% sleep to add to the columns of a data frame while avoiding cumbersome parentheses.

Usage

1
grow(..., list = character(0), from = parent.frame(), to = parent.frame())

Arguments

...

characters or symbols, names of functions to make into binary operators.

list

character vector of names of functions to make into binary operators

from

package (character scalar) or environment to look for functions to turn into binary operators.

to

environment to store the new binary operators.

Examples

1
2
3
4
grow(rbind, from = "base") # Use `from` to specify a package or environment to search.
nrow(sleep) # 20
longer = sleep %rbind% sleep %rbind% sleep # No clumsy parentheses!
nrow(longer) # 60. Most of us would like to sleep longer.

wlandau/grapes documentation built on May 4, 2019, 8:44 a.m.