Function Errors
Missing x and y for plot
Matches: supply both 'x' and 'y' or a matrix-like
WHAT THIS ERROR MEANS
The plotting function needs either both x and y vectors, or a single matrix/data frame. You provided something it can't interpret.
HOW TO FIX IT
1. Provide both x and y arguments explicitly.
2. Or pass a matrix/data frame with two columns.
3. Check that your data isn't empty.
CODE EXAMPLES
BAD — THIS CAUSES THE ERROR
plot() # no data provided
GOOD — CORRECT APPROACH
plot(x = 1:10, y = rnorm(10))
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...