Get Started →
Syntax Errors

Unexpected end of input

Matches: unexpected end of input

WHAT THIS ERROR MEANS

R reached the end of your code but was still expecting more — usually a closing parenthesis, bracket, or brace.

HOW TO FIX IT

1. Count all opening and closing brackets: (), {}, [].

2. Make sure every opening bracket has a matching close.

3. Check if a string is missing its closing quote.

CODE EXAMPLES

BAD — THIS CAUSES THE ERROR
if (x > 0) {
  print("positive")
# missing closing brace
GOOD — CORRECT APPROACH
if (x > 0) {
  print("positive")
}

Still stuck?

Paste your code in RChat and the AI will fix this error in context.

Try RChat Free →

RELATED SYNTAX ERRORS