grow {grapes} | R Documentation |
Function grow
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
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
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.
[Package grapes version 1.0.0 Index]