Skip to content

Commit

Permalink
raise error when .by is given but no across() #2207
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 6, 2023
1 parent 2c9e349 commit a768744
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/tidyverse.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ summarise.sf <- function(.data, ..., .dots, do_union = TRUE, is_coverage = FALSE
geom = list() #676 #nocov
do.call(st_sfc, c(geom, crs = list(crs), precision = precision))
} else { # single group:
if (nrow(ret) > 1)
stop(paste0("when using .by, also add across(", sf_column, ", st_union) as argument")) # https://github.com/r-spatial/sf/issues/2207
if (do_union)
st_union(geom, is_coverage = is_coverage)
else
Expand Down

0 comments on commit a768744

Please sign in to comment.