Get Started →
Subscript & Indexing Errors

Recursive indexing failed

Matches: recursive indexing failed

WHAT THIS ERROR MEANS

You tried to access a nested element in a list using [[ ]] but the path doesn't exist — one of the intermediate levels is NULL or missing.

HOW TO FIX IT

1. Check the structure with str(your_list).

2. Access one level at a time to find where it breaks.

3. Use purrr::pluck() for safe nested access.

CODE EXAMPLES

BAD — THIS CAUSES THE ERROR
result[["model"]][["coefficients"]]  # "model" may not exist
GOOD — CORRECT APPROACH
# Check structure first:
str(result)
# Then access safely:
if (!is.null(result$model)) result$model$coefficients

Still stuck?

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

Try RChat Free →

RELATED SUBSCRIPT & INDEXING ERRORS