Fixing typo in functions chapter (#1417)

This commit is contained in:
David 2023-04-10 05:40:21 +02:00 committed by GitHub
parent ae818956b2
commit 0a3456cc67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,7 @@ 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. 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`. 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 `{{ }}`: So to make grouped_mean`()` work, we need to surround `group_var` and `mean_var` with `{{ }}`:
```{r} ```{r}
grouped_mean <- function(df, group_var, mean_var) { grouped_mean <- function(df, group_var, mean_var) {