You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tidy evaluation includes a solution to this problem called **embracing** 🤗.
Embracing a variable means to wrap it in braces so (e.g.) `var` becomes `{{ var }}`.
Embracing a variable tells dplyr to use the value stored inside the argument, not the argument as the literal variable name.
One way to remember what's happening is to think of `{{ }}` as looking down a tunnel --- `{{ var }}` will make a dplyr function look inside of `var` rather than looking for a variable called `var`.
So to make `grouped_mean()` work, we need to surround `group_var` and `mean_var` with `{{ }}`:
The text was updated successfully, but these errors were encountered:
As the title says. I have checked on multiple browsers.
Here is a reference to the book part I am referring to. Not sure why this is happening!
r4ds/functions.qmd
Lines 400 to 405 in 9a9ec24
The text was updated successfully, but these errors were encountered: