Get Started →
Subscript & Indexing Errors

Cannot subset non-existent columns

Matches: Can't subset columns that don't exist

WHAT THIS ERROR MEANS

You tried to select or access columns that don't exist in the data frame. This is the tidyverse equivalent of 'undefined columns selected'.

HOW TO FIX IT

1. Check available columns with names(df).

2. Look for typos in column names.

3. Verify the column wasn't removed in a prior step.

CODE EXAMPLES

BAD — THIS CAUSES THE ERROR
df %>% select(revnue, date)  # typo in revenue
GOOD — CORRECT APPROACH
df %>% select(revenue, date)

Still stuck?

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

Try RChat Free →

RELATED SUBSCRIPT & INDEXING ERRORS