Get Started →
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.

Try RChat Free →

RELATED FUNCTION ERRORS