Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

exposition

Exposition pipe


Description

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

Examples

iris %>%
  subset(Sepal.Length > mean(Sepal.Length)) %$%
  cor(Sepal.Length, Sepal.Width)
  
data.frame(z = rnorm(100)) %$% 
  ts.plot(z)

magrittr

A Forward-Pipe Operator for R

v2.0.1
MIT + file LICENSE
Authors
Stefan Milton Bache [aut, cph] (Original author and creator of magrittr), Hadley Wickham [aut], Lionel Henry [cre], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.