Description Usage Arguments Author(s) See Also Examples
This function is used to create magrittr like pipe operators.
1 2 3 4 5 6 7 |
propagate |
character. See the eponymous argument in |
keep_also |
character. See the eponymous argument in |
try |
logical. If |
lhs |
Left-hand side of the pipe. |
rhs |
Right-hand side of the pipe. |
Stefan Milton Bache and Hadley Wickham for the
original pipe
function in package magrittr;
Paul Poncet for the modifications introduced.
shield
in this package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(dplyr)
df <- data.frame(x = sample(10, 5, rep = TRUE),
y = sample(10, 5, rep = TRUE)) %>%
at_mutate(example = "yes",
package = "dplyr",
class = c("my_tbl", "data.frame"))
tribe(df)
# Attributes just created are lost when the object
# passes through dplyr verbs
tribe(df %>% mutate(z = 3))
# With the pipe '%@>%', most attributes are kept
tribe(df %@>% mutate(z = 3))
# One can create a new pipe to adjust attributes propagation settings
"%newpipe>%" <- make_pipe(propagate = "none", keep_also = "example")
tribe(df %newpipe>% mutate(z=3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.