Function Errors
Argument matched multiple times
Matches: formal argument "([^"]+)" matched by multiple actual arguments
WHAT THIS ERROR MEANS
You provided the same argument twice — once by name and once by position, or used the same name twice.
HOW TO FIX IT
1. Remove the duplicate argument.
2. Use either positional or named arguments, not both for the same parameter.
3. Check the function signature with args(function_name).
CODE EXAMPLES
BAD — THIS CAUSES THE ERROR
rnorm(10, mean = 0, 0) # mean specified twice
GOOD — CORRECT APPROACH
rnorm(10, mean = 0, sd = 1)
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 ...
Duplicate arguments You passed the same named argument more than once to a function....