For formal documentation please see https://github.com/WinVector/wrapr/blob/master/extras/wrapr_pipe.pdf.
apply_left( pipe_left_arg, pipe_right_arg, pipe_environment, left_arg_name, pipe_string, right_arg_name )
pipe_left_arg | left argument. |
---|---|
pipe_right_arg | substitute(pipe_right_arg) argument. |
pipe_environment | environment to evaluate in. |
left_arg_name | name, if not NULL name of left argument. |
pipe_string | character, name of pipe operator. |
right_arg_name | name, if not NULL name of right argument. |
result
apply_left.character <- function(pipe_left_arg, pipe_right_arg, pipe_environment, left_arg_name, pipe_string, right_arg_name) { if(is.language(pipe_right_arg)) { wrapr::apply_left_default(pipe_left_arg, pipe_right_arg, pipe_environment, left_arg_name, pipe_string, right_arg_name) } else { paste(pipe_left_arg, pipe_right_arg) } } setMethod( wrapr::apply_right_S4, signature = c(pipe_left_arg = "character", pipe_right_arg = "character"), function(pipe_left_arg, pipe_right_arg, pipe_environment, left_arg_name, pipe_string, right_arg_name) { paste(pipe_left_arg, pipe_right_arg) }) "a" %.>% 5 %.>% 7#> Error: wrapr::apply_left.default does not allow piping into obvious concrete right-argument (clearly can't depend on left argument): #> character #> numeric#> [1] "A"q <- "z" "a" %.>% q#> [1] "a z"