x %.|% f stands for f(x[[1]], x[[2]], ..., x[[length(x)]]). v %|.% x also stands for f(x[[1]], x[[2]], ..., x[[length(x)]]). The two operators are the same, the variation just allowing the user to choose the order they write things. The mnemonic is: "data goes on the dot-side of the operator."

f %|.% args

args %.|% f

Arguments

f

function.

args

argument list or vector, entries expanded as function arguments.

Value

f(args) where args elements become individual arguments of f.

Details

Note: the reduce operation is implemented by do.call(), so has standard R named argument semantics.

Functions

  • %|.%: f reduce args

  • %.|%: args expand f

See also

Examples

args <- list('prefix_', c(1:3), '_suffix') args %.|% paste0
#> [1] "prefix_1_suffix" "prefix_2_suffix" "prefix_3_suffix"
# prefix_1_suffix" "prefix_2_suffix" "prefix_3_suffix" paste0 %|.% args
#> [1] "prefix_1_suffix" "prefix_2_suffix" "prefix_3_suffix"
# prefix_1_suffix" "prefix_2_suffix" "prefix_3_suffix"