summarize anomaly

From the summarise() documentation, in the examples:

# Note that with data frames, newly created summaries immediately
# overwrite existing variables
mtcars %>%
  group_by(cyl) %>%
  summarise(disp = mean(disp), sd = sd(disp))
#> # A tibble: 3 x 3
#>     cyl  disp    sd
#>   <dbl> <dbl> <dbl>
#> 1     4  105.    NA
#> 2     6  183.    NA
#> 3     8  353.    NA

I have seen people miss critical details of summarise() before because they’re included in the examples and not in the main documentation. This bit is obliquely mentioned in the main text of the docs (under “Backend variations”). I’d love to see more of the details of how the function works in the main text of the documentation, but I haven’t really done anything useful about that opinion, like submitting a PR :upside_down_face:.

2 Likes