AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Unlicense Self-run

Coding In R

skill-yale-som-hpc-claude-code-marketplace-coding-in-r · by yale-som-hpc

How to write R well — renv, tidyverse/data.table, project paths, style, scripts, seeds. TRIGGER when authoring or editing .R/.Rmd/.qmd files. For running R on the Yale SOM HPC cluster (Slurm, renv on /gpfs), use running-r instead.

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add skill-yale-som-hpc-claude-code-marketplace-coding-in-r

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-yale-som-hpc-claude-code-marketplace-coding-in-r)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Coding In R? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Coding in R

Rule: renv, portable paths, script as source of truth. Never rely on the global workspace.

For cluster execution, also load [running R](../running-r/SKILL.md).

Defaults

  • renv for package versions. Commit renv.lock and .Rprofile.
  • On SOM HPC: module load r; no rig or mise default.
  • pak for fast installs when available.
  • styler for formatting.
  • lintr for linting.
  • here::here() for paths. No setwd() in tracked scripts.
  • readr::read_csv() over base read.csv().
install.packages("renv")
renv::init()
renv::install(c("tidyverse", "data.table", "here", "fs", "styler", "lintr"))
renv::snapshot()

Restore with:

renv::restore()

On HPC, restore once before arrays. Do not let many workers install packages concurrently.

Layout

project/
├── renv.lock
├── .Rprofile
├── README.md
├── scripts/       # entry points
├── R/             # shared helpers
├── notebooks/     # .Rmd / .qmd
├── data/raw/      # immutable; usually ignored
├── data/derived/  # rebuildable
└── results/       # figures/tables/logs

Paths

Never commit setwd() or personal absolute paths.

library(here)
counts_path ` unless `%>%` materially helps.
- 2-space indentation; aim for 80-char lines, max 120.
- Named arguments: `mean(x, na.rm = TRUE)`, not `mean(x, T)`.
- `library()` at top.
- Never `attach()` or `<<-`.
- `set.seed(42)` before stochastic work.

## Data

Default to tidyverse for clarity. Use data.table when data are large, joins/grouping dominate, or in-place mutation matters. Benchmark before rewriting clear code for speed.

## CLI skeleton

```r
#!/usr/bin/env Rscript
suppressPackageStartupMessages({
  library(optparse)
})

option_list <- list(
  make_option(c("-i", "--input"), type = "character"),
  make_option(c("-o", "--output"), type = "character")
)
opt <- parse_args(OptionParser(option_list = option_list))
if (is.null(opt$input) || is.null(opt$output)) {
  stop("--input and --output are required", call. = FALSE)
}

set.seed(42)

Checklist

  • [ ] styler::style_dir(".") run
  • [ ] lintr::lint_dir(".") clean or justified
  • [ ] No setwd() or personal paths
  • [ ] set.seed() where needed
  • [ ] renv::snapshot() if deps changed
  • [ ] Small smoke test run
  • [ ] HPC uses module load r + renv, not rig/mise

Further reading

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.