apply_left | R Documentation |
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.default
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
"a" %.>% toupper(.)
q <- "z"
"a" %.>% q
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.