skills/r-renv/SKILL.md
R renv package management for data science projects. Use when working with renv (renv.lock, renv::restore, renv::snapshot) in R analysis projects. Do NOT load for projects that do not use R or renv.
npx skillsauth add musserlab/lab-claude-skills r-renvInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use rig to install and switch between multiple R versions.
rig list # View installed versions
rig add release # Install latest stable R
rig add 4.4 # Install specific version
rig default 4.4 # Set system default
rig default # Show current default
Pin the R version in .positron/settings.json (not committed to git):
macOS (Apple Silicon):
{
"r.rpath.mac": "/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/bin/R"
}
macOS (Intel):
{
"r.rpath.mac": "/Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/bin/R"
}
Alternative: Use Positron's Command Palette (Cmd+Shift+P) → "R: Select R Binary".
Most R projects use renv for reproducible package management.
renv::status() # Check sync status
renv::restore() # Install packages from lockfile
renv::snapshot() # Record current packages to lockfile
renv::install("pkg") # Install a package
renv::update() # Update all packages
.Rprofile when R starts in the project directoryrenv::status() to see detailsrenv::restore()renv::snapshot() then commit renv.lock to gitCommit: renv.lock, renv/activate.R, .Rprofile
Ignore: renv/library/, renv/staging/, renv/local/
Bioconductor packages have coordinated releases tied to R versions.
install.packages("BiocManager")
BiocManager::install("DESeq2")
BiocManager::install(c("limma", "edgeR", "tximport"))
renv::snapshot() # Always snapshot after installing
With renv, you can also use:
renv::install("bioc::DESeq2")
| R Version | Bioconductor Version | |-----------|---------------------| | R 4.3.x | Bioconductor 3.18 | | R 4.4.x | Bioconductor 3.19–3.20 | | R 4.5.x | Bioconductor 3.21 |
Check your current version:
BiocManager::version()
If renv reports Bioconductor version mismatches, verify that BiocManager::version() matches what's expected for your R version.
→ Run renv::status() to see details. Run renv::restore() to sync, or renv::snapshot() if you've installed new packages.
→ Try renv::install("package", rebuild = TRUE)
→ renv::deactivate(), remove renv/ and .Rprofile, then renv::init()
development
Phylogenetic tree visualization and formatting with ggtree (R) or iTOL (web). Use when rendering a phylogenetic tree as a figure, choosing tree layout, coloring branches or labels by taxonomy, collapsing clades, displaying support values, or adding overlays to a tree. Do NOT load for tree inference (use protein-phylogeny skill) or domain annotation (future separate skill).
development
Configure and manage Claude Code security protections for sensitive files, credentials, and data. Use when the user invokes /security-setup to set up or modify protections against unauthorized file access, credential exposure, or sensitive data leaks.
development
Script organization for data science analysis projects with numbered scripts, data/outs/ directories, and reproducibility conventions. Use when creating new analysis scripts in projects that follow data science conventions (numbered XX_ prefix scripts, outs/ directories, BUILD_INFO.txt). Do NOT load for documentation projects (Quarto books), infrastructure repos, or projects without data/outs/ directory structure.
development
R ggplot2 plotting conventions and theme. Use when creating, modifying, or styling ggplot2 plots in R, or when adjusting plot themes, colors, labels, or formatting.