Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dplyr (development version)

* `tally_n()` creates fully qualified funciton calls for duckplyr compatibility (#7046)

* `storms` has been updated to include 2023 and 2024 data (#7111, @tomalrussell).

* Empty `rowwise()` list-column elements now resolve to `logical()` rather than a random logical of length 1 (#7710).
Expand Down
4 changes: 2 additions & 2 deletions R/count-tally.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ add_tally <- function(x, wt = NULL, sort = FALSE, name = NULL) {

tally_n <- function(x, wt) {
if (quo_is_null(wt)) {
expr(n())
expr(dplyr::n())
} else {
expr(sum(!!wt, na.rm = TRUE))
expr(base::sum(!!wt, na.rm = TRUE))
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/_snaps/count-tally.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
Output
<error/rlang_error>
Error in `count()`:
i In argument: `n = sum(1 + "", na.rm = TRUE)`.
i In argument: `n = base::sum(1 + "", na.rm = TRUE)`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator

Expand Down Expand Up @@ -84,7 +84,7 @@
Output
<error/rlang_error>
Error in `tally()`:
i In argument: `n = sum(1 + "", na.rm = TRUE)`.
i In argument: `n = base::sum(1 + "", na.rm = TRUE)`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator

Expand Down Expand Up @@ -143,7 +143,7 @@
Output
<error/dplyr:::mutate_error>
Error in `add_count()`:
i In argument: `n = sum(1 + "", na.rm = TRUE)`.
i In argument: `n = base::sum(1 + "", na.rm = TRUE)`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator

Expand All @@ -154,7 +154,7 @@
Output
<error/dplyr:::mutate_error>
Error in `add_tally()`:
i In argument: `n = sum(1 + "", na.rm = TRUE)`.
i In argument: `n = base::sum(1 + "", na.rm = TRUE)`.
Caused by error in `1 + ""`:
! non-numeric argument to binary operator

Expand Down