/analytics-toolkit:r-parallelfrom analytics-toolkit
Use when the user wants to parallelize R code, speed up R scripts, or convert sequential loops/apply calls to parallel execution using the future framework
Ships in analytics-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Converts sequential R code to parallel execution using the future ecosystem, with correct seed handling for reproducibility and cross-platform backends.
NEVER:
set.seed() inside parallel workersplan(multicore) — not cross-platform (unreliable on macOS, unavailable on Windows)parallel, doParallel, or doSNOW — everything uses the future ecosystemMUST:
plan(multisession) as default backendlibrary() calls present for new packages.drafts/<filename>_sequential.R before any editsCAN:
progressr progress reporting for long tasksAsk user when:
set.seed() calls with unclear intentHand off to user when:
.drafts/ archive, commit the revert, and explain what was attemptedProceed when:
references/pitfalls.md.drafts/ subfolder if needed; copy original to .drafts/<filename>_sequential.R"Archive sequential version of <filename> before parallelizing"future.apply (base R), furrr (purrr), doFuture (foreach)references/future-patterns.mdreferences/seed-handling.mdplan(multisession) setup block at toplibrary() calls for new packagesprogressr progress reporting"Parallelize <filename>: <2-3 sentence summary of changes>"references/seed-handling.md §I"Verified <filename>: parallel outputs match sequential".drafts/ archive, git commit the revert, report what diverged, and hand off to the user| Signal in code | Category | Parallel replacement | Package |
|---|---|---|---|
for (i in ...) { results[[i]] <- ... } | Accumulating for-loop | future_lapply() | future.apply |
lapply(x, fun) | Base apply | future_lapply(x, fun) | future.apply |
sapply(x, fun) | Base apply | future_sapply(x, fun) | future.apply |
vapply(x, fun, type) | Base apply | future_vapply(x, fun, type) | future.apply |
mapply(fun, x, y) / Map(fun, x, y) | Base apply | future_mapply(fun, x, y) | future.apply |
tapply(x, index, fun) | Base apply | future_tapply(x, index, fun) | future.apply |
replicate(n, expr) | Replication | future_lapply(1:n, function(i) expr) | future.apply |
purrr::map(x, fun) | purrr | furrr::future_map(x, fun) | furrr |
purrr::map_dfr(x, fun) | purrr | furrr::future_map_dfr(x, fun) | furrr |
purrr::map2(x, y, fun) | purrr | furrr::future_map2(x, y, fun) | furrr |
purrr::pmap(list, fun) | purrr | furrr::future_pmap(list, fun) | furrr |
foreach(i=...) %do% {...} | foreach | foreach(i=...) %dofuture% {...} | doFuture |
| Nested loops → matrix/list | Nested loop | Flatten to single future_lapply() | future.apply |
plan(multisession) alwaysfuture.seed = TRUE / furrr_options(seed = TRUE) / .options.future = list(seed = TRUE)future.globals / future.packageslibrary(progressr); handlers(global = TRUE); with_progress({ ... })plan(sequential) at endavailableCores() to detect; plan(multisession, workers = N) to set.drafts/ subfolder, _sequential suffix, never alongside working filesWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub halidaee/econtools_marketplace --plugin analytics-toolkit4 skills in this plugin
/dependency-trackerUse when auditing research pipelines in economics projects, checking for stale outputs, broken dependencies between data/scripts/manuscripts, or mapping data flow from raw inputs to final LaTeX outputs/renv-managerUse when transitioning R projects to renv, setting up reproducible R environments, or migrating from global package libraries without breaking existing analysis code/r-styleUse when the user has FINISHED R analysis code and wants it cleaned up for human readability — removes LLM code smells, rewrites to match personal style. Only use after analysis is complete and outputs are verified, never during initial development or debugging.Other plugins' skills for the same job