%.% {quickcode} | R Documentation |
simple function chaining routine
Description
chain multiple function to a call
Usage
obj %.% funcs
chain_sep(sep = "\\.\\.")
Arguments
obj |
data object to apply function |
funcs |
function chains to apply to the data object |
sep |
separator for functions argument values |
Value
the result of applying the chained functions to the data object
Note
chain_sep allows the user to preset the separator for the function chaining
e.g. you can call the function to set sep = "__" before using the
Examples
#use default sep ".."
1:3%.%unique..length
sample(1:1000,10,replace=TRUE) %.%unique..length
sample(1:10,10,replace=TRUE) %.%unique..cumsum
# set sep before function chaining
chain_sep("__")
sample(1:10,10,replace=TRUE) %.%unique__cumsum
sample(1:10,10,replace=TRUE) %.%unique__cumsum__length
# set sep before function chaining
chain_sep("X")
sample(1:10,10,replace=TRUE) %.%uniqueXcumsum
[Package quickcode version 1.0.8 Index]