From 7d190603b9d7a778b7a6682aba5aee7f45f7ef85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 30 Jun 2024 18:48:51 +0200 Subject: [PATCH] Create quosures in `tally_n()` --- R/count-tally.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/count-tally.R b/R/count-tally.R index f5c94c959f..75bd8378ba 100644 --- a/R/count-tally.R +++ b/R/count-tally.R @@ -213,9 +213,9 @@ tally_n <- function(x, wt) { } if (quo_is_null(wt)) { - expr(n()) + new_quosure(expr(n()), asNamespace("dplyr")) } else { - expr(sum(!!wt, na.rm = TRUE)) + new_quosure(expr(sum(!!wt, na.rm = TRUE)), quo_get_env(wt)) } }