See magrittr::[\%>\%][magrittr::pipe]
for details.
1 2 3 4 5 | lhs %>% rhs
lhs %$% rhs
lhs %T>% rhs
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Quick introduction to pipe operators
x <- 1:5
### %>% the forward operator
x %>% mean()
# is equivalent to
mean(x)
### %T>% the tee operator
x %T>% plot %>% mean()
# it takes left hand side, do something (here a plot)
# then pass it to next function (mean)
### %$% the exposition operator
l <- list(x=x, x2=x^2)
l %$% x
# or
l %$% mean(x2)
# names in l (x and x2) are "exposed" to right hand side
# See magrittr vignette for more!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.