Package Errors
Package load failed
Matches: package or namespace load failed
WHAT THIS ERROR MEANS
The package exists but couldn't be loaded, usually because one of its dependencies is missing or incompatible.
HOW TO FIX IT
1. Try reinstalling: install.packages('package', dependencies = TRUE).
2. Check which dependency failed in the full error message.
3. Install the missing dependency separately.
CODE EXAMPLES
BAD — THIS CAUSES THE ERROR
library(rJava) # requires Java runtime
GOOD — CORRECT APPROACH
# Install system dependency first, then:
install.packages("rJava", dependencies = TRUE)Still stuck?
Paste your code in RChat and the AI will fix this error in context.