SkillHub

debugging-r-environment-and-dependencies

v0.1.0

Diagnose and fix R environment issues, including package installation failures, dependency conflicts, system library problems, renv errors, and Bioconductor version mismatches.

Sourced from ClawHub, Authored by JackKuo666

Installation

Please help me install the skill `debugging-r-environment-and-dependencies` from SkillHub official store. npx skills add JackKuo666/debugging-r-environment-and-dependencies

Debugging R Environment and Dependencies

This skill focuses on resolving problems related to R environments rather than analysis logic. It helps restore a working setup so that R scripts and projects can run successfully.

Use this skill when the user encounters: - Package installation failures - Version conflicts between packages - renv or packrat environment issues - Bioconductor version mismatches - System dependency errors (e.g., missing compilers or libraries) - R failing to start or load packages


What This Skill Does

When activated, this skill will:

  1. Diagnose the environment
  2. Check R version
  3. Check installed packages and versions
  4. Inspect renv.lock or project library
  5. Identify Bioconductor version compatibility

  6. Resolve package installation issues

  7. Suggest correct CRAN/Bioconductor repositories
  8. Install missing system dependencies (e.g., libxml2, curl, openssl)
  9. Handle compilation failures on Linux/macOS/Windows

  10. Fix dependency conflicts

  11. Align package versions
  12. Reinstall broken packages
  13. Clean corrupted package libraries

  14. Repair project environments

  15. Restore with renv::restore()
  16. Rebuild renv.lock
  17. Reinitialize project library if needed

  18. Bioconductor troubleshooting

  19. Match Bioconductor version to R version
  20. Use BiocManager::install() correctly
  21. Resolve common bioinformatics package errors

  22. System-level troubleshooting

  23. Install missing compilers (e.g., gcc, gfortran)
  24. Install development libraries required for R packages
  25. Fix PATH or permission issues

Example User Requests That Should Trigger This Skill

  • "I can't install tidyverse"
  • "This package fails with a compilation error"
  • "renv restore is broken"
  • "Bioconductor says my version is incompatible"
  • "library() fails even though the package is installed"
  • "R says shared object cannot be loaded"

Example Workflow

User: I get an error when installing sf.

Skill actions: - Detect missing system libraries (GEOS, GDAL, PROJ) - Provide OS-specific install commands - Retry R package installation - Confirm successful library loading


Common Problem Categories

Category Examples
Missing system libs xml2, curl, openssl, sf, rJava
Compiler issues gfortran missing, Xcode tools missing
Version mismatch old R vs new package
Bioconductor mismatch wrong Bioc version for R
renv problems corrupted cache, lockfile mismatch
Permission issues cannot write to library path

Notes

  • Do not modify analysis code unless necessary
  • Prefer fixing the environment over rewriting scripts
  • Always aim to make the project reproducible
  • Recommend renv for future environment stability