SkillHub

running-r-analysis-in-existing-projects

v0.1.0

Work inside an existing R project to extend analyses, modify scripts, run statistical models, update visualizations, and regenerate reports.

Sourced from ClawHub, Authored by JackKuo666

Installation

Please help me install the skill `running-r-analysis-in-existing-projects` from SkillHub official store. npx skills add JackKuo666/running-r-analysis-in-existing-projects

Running R Analysis in Existing Projects

This skill operates inside an already structured R project. It helps extend, debug, or enhance existing analyses without recreating the project from scratch.

Use this skill when the user wants to: - Continue analysis in an existing R project - Modify or extend R scripts - Add new statistical models or tests - Update plots or figures - Regenerate reports after data or code changes - Debug R errors in a project


What This Skill Does

When activated, this skill will:

  1. Understand the project structure
  2. Detect folders like data/, scripts/, results/, reports/
  3. Identify .Rproj, .Rmd, .qmd, or .R files

  4. Inspect existing analysis

  5. Read current scripts and reports
  6. Identify which packages and methods are being used
  7. Avoid rewriting working components unnecessarily

  8. Extend or modify analysis

  9. Add new models or statistical tests
  10. Introduce new plots using ggplot2
  11. Add new data processing steps
  12. Improve code structure or reproducibility

  13. Re-run and update outputs

  14. Recompute results
  15. Overwrite or version new outputs in results/
  16. Re-render R Markdown or Quarto reports

  17. Debug issues

  18. Fix missing packages
  19. Resolve file path problems
  20. Handle common R errors and warnings

Example User Requests That Should Trigger This Skill

  • "Add a survival analysis to this R project"
  • "Update the plots in my report"
  • "This R Markdown file throws an error, fix it"
  • "Extend this analysis with a mixed-effects model"
  • "Re-run everything after I updated the data"

Example Workflow

User: Add a logistic regression model and update the report.

Skill actions: - Locate main analysis script - Add logistic regression using glm() - Save model summary to results/ - Update report with new section and plot - Re-render HTML/PDF report


Tools & Packages Commonly Used

Purpose R Packages
Data wrangling tidyverse, dplyr
Modeling stats, lme4, glmnet
Visualization ggplot2
Reporting rmarkdown, quarto
Project management here, renv

Notes

  • Respect the existing project structure and style
  • Do not delete user code unless explicitly requested
  • Prefer incremental updates over full rewrites
  • Always regenerate reports after modifying analysis