Skip to content

Commit a768744

Browse files
committed
raise error when .by is given but no across() #2207
1 parent 2c9e349 commit a768744

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/tidyverse.R

+2
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ summarise.sf <- function(.data, ..., .dots, do_union = TRUE, is_coverage = FALSE
308308
geom = list() #676 #nocov
309309
do.call(st_sfc, c(geom, crs = list(crs), precision = precision))
310310
} else { # single group:
311+
if (nrow(ret) > 1)
312+
stop(paste0("when using .by, also add across(", sf_column, ", st_union) as argument")) # https://github.com/r-spatial/sf/issues/2207
311313
if (do_union)
312314
st_union(geom, is_coverage = is_coverage)
313315
else

0 commit comments

Comments
 (0)