%$%

0th

Percentile

Exposition pipe

Expose the names in lhs to the rhs expression. This is useful when functions do not have a built-in data argument.

Usage
lhs %$% rhs
Arguments
lhs

A list, environment, or a data.frame.

rhs

An expression where the names in lhs is available.

Details

Some functions, e.g. lm and aggregate, have a data argument, which allows the direct use of names inside the data as part of the call. This operator exposes the contents of the left-hand side object to the expression on the right to give a similar benefit, see the examples.

See Also

%>%, %<>%, %T>%

Aliases
  • %$%
Examples
# NOT RUN {
iris %>%
  subset(Sepal.Length > mean(Sepal.Length)) %$%
  cor(Sepal.Length, Sepal.Width)
  
data.frame(z = rnorm(100)) %$% 
  ts.plot(z)
  
# }
Documentation reproduced from package magrittr, version 2.0.1, License: MIT + file LICENSE

Community examples

vlad@datastars.com.au at Sep 28, 2018 magrittr v1.5

## Plot function of a single variable ```{r} library(dplyr) library(magrittr) library(ggplot2) data.frame(x = seq(-1, 1, 0.1)) %>% mutate(y = x^2) %$% qplot(x, y) ```