Skip to content

Commit

Permalink
Create quosures in tally_n()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jun 30, 2024
1 parent 0005f67 commit 7d19060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/count-tally.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit 7d19060

Please sign in to comment.