dplyr summarize vs summarise in R: Same Function
In dplyr, summarize() (American spelling) and summarise() (British spelling) are EXACT ALIASES of the same function. Pick one and stick with it; both produce identical results.
df |> summarise(avg = mean(x)) # British df |> summarize(avg = mean(x)) # American (same function) identical(summarise, summarize) # TRUE df |> group_by(g) |> summarise(avg = mean(x)) df |> summarise(.by = g, avg = mean(x)) # dplyr 1.1+ scoped grouping
Need explanation? Read on for examples and pitfalls.
What summarize / summarise does in one sentence
summarise(.data, ...) and summarize(.data, ...) collapse rows into one (or more) per group, computing aggregations specified in .... They are EXACT aliases, both are defined to point at the same internal function.
Syntax
Both spellings: identical signatures, identical behavior.
summarise (British). dplyr was written by Hadley Wickham (NZ-based), so British spelling is the canonical choice. American developers may prefer summarize; the function literally doesn't care.Five common patterns
1. Grouped aggregation
2. Same with American spelling
3. Modern .by syntax (dplyr 1.1+)
summarize with .by works the same way.
4. Both spellings can coexist (but don't mix)
5. Verify they're the same
summarise() vs summarize() vs aggregate()
Three "summarise" approaches in R.
| Function | Package | Spelling |
|---|---|---|
summarise(...) |
dplyr | British |
summarize(...) |
dplyr | American |
aggregate(...) |
base R | n/a |
summarise and summarize are aliases. aggregate is the base R alternative; it has different syntax and is less pipe-friendly.
When to use which:
summarisefor tidyverse style.summarizefor American teams.aggregateonly when avoiding tidyverse dependency.
A practical workflow
Pick one spelling per project and stick with it. Mixing the two within one codebase doesn't break anything but makes code review harder. Most tidyverse codebases use summarise; many enterprise R codebases use summarize.
The lintr / styler tools generally don't enforce one spelling over the other.
Common pitfalls
Pitfall 1: searching code with the wrong spelling. If you search for summarise and the codebase uses summarize, you miss results. Use a regex search: summari[sz]e.
Pitfall 2: editor autocompletion lock-in. Some IDEs autocomplete one spelling but not the other depending on which you type first. Be deliberate.
summarise and summarize BOTH have a .by argument in dplyr 1.1+. Don't assume only one supports the modern features. They are exact aliases.Try it yourself
Try it: Compute mean mpg per cyl using BOTH summarise and summarize, then verify the results are identical. Save to ex_check.
Click to reveal solution
Explanation: Both spellings produce byte-identical results.
Related dplyr functions
After mastering both spellings, look at:
reframe(): variable-row-output cousin (1.1+)mutate(): per-row transformationgroup_by(): grouping context.by: scoped grouping (1.1+)count(): shortcut for group_by + summarise(n = n())
For most workflows, summarise/summarize is the workhorse, pick one and use it consistently.
Why dplyr supports both spellings
Hadley Wickham (dplyr's author) is from New Zealand and uses British spelling. US users repeatedly asked for the American spelling. Adding both as aliases satisfies both camps with zero behavioral cost. This is a small but representative example of the tidyverse's openness to multiple regional preferences (the same pattern applies to colour/color in ggplot2).
FAQ
Is summarize the same as summarise in dplyr?
Yes. They are exact aliases. identical(dplyr::summarise, dplyr::summarize) returns TRUE.
Which spelling should I use?
Personal preference. The tidyverse style guide uses summarise (British). American developers often prefer summarize. Pick one and be consistent within a project.
Does the dplyr documentation use summarise or summarize?
Both. The official dplyr help pages document summarise first with summarize listed as an alias.
Can I mix both spellings in the same script?
Yes, technically, but it's bad style. Mixing harms readability without any benefit. Pick one.
Do other dplyr verbs have American spellings?
Mostly no. summarise/summarize is the main aliased pair. Other functions like select, mutate, filter have only one spelling each.