From fd39b442f4b26b125c1e65504e82a5450d3374da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mine=20=C3=87etinkaya-Rundel?= Date: Thu, 9 Nov 2023 09:32:17 -0500 Subject: [PATCH] Call it walrus operator, closes #1591 --- functions.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.qmd b/functions.qmd index 3286c1b..4986523 100644 --- a/functions.qmd +++ b/functions.qmd @@ -737,7 +737,7 @@ sorted_bars <- function(df, var) { diamonds |> sorted_bars(clarity) ``` -We have to use a new operator here, `:=`, because we are generating the variable name based on user-supplied data. +We have to use a new operator here, `:=` (commonly referred to as the "walrus operator"), because we are generating the variable name based on user-supplied data. Variable names go on the left hand side of `=`, but R's syntax doesn't allow anything to the left of `=` except for a single literal name. To work around this problem, we use the special operator `:=` which tidy evaluation treats in exactly the same way as `=`.