New to R. Can anybody explain .group("drop")

Hi,
New to R. Can anybody explain how to use .group("drop")? Why do we need .group = "drop". Please see the example below. Thanks

filtered_toothgrowth <- ToothGrowth %>%
filter(dose == 0.5) %>%
group_by(supp) %>%
summarize(mean_len = mean(len, na.rm = T), .group = "drop")

It should be .groups = "drop" (plural)

In your particular example it doesn't matter, but when there are more than one grouping variables it does.

The default behaviour is to drop the last variable as that was the behaviour before the .groups argument was introduced. Dropping all variables would make more sense, but the default is there for backward compatibility.

Thank you Martin.
so the .groups = "drop" is related to group_by(supp)?
What does it mean "dropping all variables"?

Regards

Yes, it refers to the variable(s) within group_by().

This explains the options:
Summarise each group down to one row — summarise • dplyr

The accepted answer to this question provides a better explanation than I can:
r - How to interpret dplyr message summarise() regrouping output by 'x' (override with .groups argument)? - Stack Overflow

Thank you! have a nice day!