What if we want to pass in different variables?
- Instead of writing out the entire
aes()
, the user can just pass in the variable names - But there’s a catch!
This doesn’t work:
Aesthetic mapping:
* `x` -> `x_var`
We can “embrace” the argument to tell ggplot2 to “look inside” the argument and use its value, not its expression
Aesthetic mapping:
* `x` -> `abc`
New version of the piechart function: