Function Errors
Unused argument
Matches: unused argument
WHAT THIS ERROR MEANS
You passed an argument to a function that doesn't accept it. This often happens from typos in argument names or using arguments from a different function.
HOW TO FIX IT
1. Check the function's documentation with ?function_name.
2. Look for typos in argument names.
3. Make sure you're using the right function.
CODE EXAMPLES
BAD — THIS CAUSES THE ERROR
mean(x = c(1, 2, 3), na.action = TRUE)
GOOD — CORRECT APPROACH
mean(x = c(1, 2, 3), na.rm = TRUE)
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...
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...
Duplicate arguments You passed the same named argument more than once to a function....