This is admittedly a small niche, but noticed the inconsistency when checking that my method matched for summarise matched dplyr's behavior.
In most situations this summarise would return a single row data.frame and so the groups wouldn't matter, but because we can now return multiple rows, it seems inconsistent to me.
library(dplyr)
df <- mtcars %>%
summarize(x = range(mpg), .groups = "rowwise")
df
#> x
#> 1 10.4
#> 2 33.9
inherits(df, "rowwise_df") # expected TRUE
#> [1] FALSE
class(df)
#> [1] "data.frame"
df_grp <- mtcars %>%
group_by(cyl) %>%
summarize(x = range(mpg), .groups = "rowwise")
df_grp
#> # A tibble: 6 x 2
#> # Rowwise: cyl
#> cyl x
#> <dbl> <dbl>
#> 1 4 21.4
#> 2 4 33.9
#> 3 6 17.8
#> 4 6 21.4
#> 5 8 10.4
#> 6 8 19.2
inherits(df_grp, "rowwise_df")
#> [1] TRUE
class(df_grp)
#> [1] "rowwise_df" "tbl_df" "tbl" "data.frame"
This is admittedly a small niche, but noticed the inconsistency when checking that my method matched for
summarisematched dplyr's behavior.In most situations this summarise would return a single row data.frame and so the groups wouldn't matter, but because we can now return multiple rows, it seems inconsistent to me.