Get Started →
Function Errors

summarise result size

Matches: Result must be size 1, not

WHAT THIS ERROR MEANS

Inside summarise(), each summary expression must return a single value per group. You used a function that returns multiple values.

HOW TO FIX IT

1. Use a summary function like mean(), sum(), n(), first(), last().

2. If you need multiple values, use reframe() instead of summarise().

3. Wrap in list() if you need to store vectors.

CODE EXAMPLES

BAD — THIS CAUSES THE ERROR
df %>% group_by(category) %>% summarise(values = range(price))
GOOD — CORRECT APPROACH
df %>% group_by(category) %>% summarise(min_price = min(price), max_price = max(price))

Still stuck?

Paste your code in RChat and the AI will fix this error in context.

Try RChat Free →

RELATED FUNCTION ERRORS