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.
RELATED FUNCTION ERRORS
Function not found R doesn't recognize the function you're trying to call. The package containing i...
Unused argument You passed an argument to a function that doesn't accept it. This often happens ...
Missing required argument A function requires a specific argument that you didn't provide, and there's no ...
Argument matched multiple times You provided the same argument twice — once by name and once by position, or use...