MCP HubMCP Hub
SKILL·1610A8

manage-renv-dependencies

pjt222
업데이트됨 1 month ago
9 조회
26
3
26
GitHub에서 보기
기타aiapiautomation

정보

이 스킬은 개발자가 renv를 사용하여 R 패키지 의존성을 관리하고 재현 가능한 환경을 구축하도록 돕습니다. R 프로젝트의 초기화, 스냅샷/복원 워크플로우, 문제 해결, CI/CD 통합을 처리합니다. 새 프로젝트 설정, 다른 머신에서 환경 복원, 의존성 문제 해결 시 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/manage-renv-dependencies

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Manage renv Dependencies

Setup + maintain reproducible R pkg envs via renv.

Use When

  • Init dep mgmt for new R project
  • Add / update pkg deps
  • Restore env on new machine
  • Troubleshoot renv restore fails
  • Integrate renv w/ CI/CD

In

  • Req: R project dir
  • Opt: Existing renv.lock (for restore)
  • Opt: GitHub PAT for private pkgs

Do

Step 1: Init renv

renv::init()

Creates:

  • renv/ dir (library, settings, activation script)
  • renv.lock (dep snapshot)
  • Updates .Rprofile → activate renv on load

→ Project-local lib created. renv/ dir + renv.lock present. .Rprofile updated w/ activation.

If err: Hangs → check network. Fails on specific pkg → install manually first w/ install.packages() + rerun renv::init().

Step 2: Add Deps

Install pkgs as usual:

install.packages("dplyr")
renv::install("github-user/private-pkg")

Snapshot to record state:

renv::snapshot()

renv.lock updated w/ new pkgs + vers. renv::status() shows no out-of-sync.

If err: Snapshot reports validation errs → renv::dependencies() to check which pkgs actually used → renv::snapshot(force = TRUE) to bypass validation.

Step 3: Restore on Another Machine

renv::restore()

→ All pkgs installed at exact vers in renv.lock.

If err: Common issues: GitHub pkgs fail (set GITHUB_PAT in .Renviron), sys deps missing (install w/ apt-get on Linux), timeouts on large pkgs (options(timeout = 600) before restore), or binaries not avail (renv compiles from source → ensure build tools installed).

Step 4: Update Deps

# Update a specific package
renv::update("dplyr")

# Update all packages
renv::update()

# Snapshot after updates
renv::snapshot()

→ Target pkgs updated to latest compatible vers. renv.lock reflects new vers after snapshot.

If err: Update fails for specific pkg → install directly w/ renv::install("package@version") + snapshot.

Step 5: Check Status

renv::status()

→ "No issues found" or clear list of out-of-sync pkgs w/ actionable guidance.

If err: Status reports pkgs used but not recorded → renv::snapshot(). Recorded but not installed → renv::restore().

Step 6: Config .Rprofile for Conditional Activation

if (file.exists("renv/activate.R")) {
  source("renv/activate.R")
}

Ensures project works even if renv not installed (CI envs, collaborators).

→ R sessions activate renv auto when starting in project dir. Sessions w/o renv still start w/o errs.

If err: .Rprofile causes errs → ensure file.exists() guard present. Never call source("renv/activate.R") unconditionally.

Step 7: Git Config

Track:

renv.lock           # Always commit
renv/activate.R     # Always commit
renv/settings.json  # Always commit
.Rprofile           # Commit (contains renv activation)

Ignore (already in renv's .gitignore):

renv/library/       # Machine-specific
renv/staging/       # Temporary
renv/cache/         # Machine-specific cache

renv.lock, renv/activate.R, renv/settings.json tracked by Git. Machine-specific dirs (renv/library/, renv/cache/) ignored.

If err: renv/library/ accidentally committed → remove w/ git rm -r --cached renv/library/ + add to .gitignore.

Step 8: CI/CD Integration

GitHub Actions → renv cache action:

- uses: r-lib/actions/setup-renv@v2

Automatically restores from renv.lock w/ caching.

→ CI pipeline restores pkgs from renv.lock w/ caching. Subsequent runs faster due to cached pkgs.

If err: CI restore fails → check renv.lock committed + up to date. Private GitHub pkgs → ensure GITHUB_PAT set as repo secret.

Check

  • renv::status() reports no issues
  • renv.lock committed to VC
  • renv::restore() works on clean checkout
  • .Rprofile conditionally activates renv
  • CI/CD uses renv.lock for dep resolution

Traps

  • Run renv::init() in wrong dir: Always verify getwd() first
  • Mix renv + sys library: After init, only use project library
  • Forget to snapshot: After installing, always renv::snapshot()
  • --vanilla flag: Rscript --vanilla skips .Rprofile → renv won't activate
  • Large lock files in diffs: Normal — renv.lock designed to be diffable JSON
  • Bioconductor pkgs: Use renv::install("bioc::PackageName") + ensure BiocManager configured

  • create-r-package — includes renv init
  • setup-github-actions-ci — CI integration w/ renv
  • submit-to-cran — dep mgmt for CRAN pkgs

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/manage-renv-dependencies
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams
FAQ

Frequently asked questions

What is the manage-renv-dependencies skill?

manage-renv-dependencies is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform manage-renv-dependencies-related tasks without extra prompting.

How do I install manage-renv-dependencies?

Use the install commands on this page: add manage-renv-dependencies to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does manage-renv-dependencies belong to?

manage-renv-dependencies is in the Other category, tagged ai, api and automation.

Is manage-renv-dependencies free to use?

Yes. manage-renv-dependencies is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

연관 스킬

llamaguard
기타

LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.

스킬 보기
cost-optimization
기타

이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.

스킬 보기
sports-betting-analyzer
기타

이 Claude Skill은 스프레드, 오버/언더, 프로프 베트를 포함한 스포츠 베팅 시장을 분석합니다. 역사적 추이와 상황별 통계를 검토하여 가치 베트를 발견하고, 교육적 목적으로 실행 가능한 권장 사항이 담긴 구조화된 마크다운 결과를 제공합니다. 개발자는 이 기능을 스포츠 베팅 분석 도구에 활용할 수 있으며, 단순히 엔터테인먼트/교육 목적으로만 설계되었음을 유의해야 합니다.

스킬 보기
quantizing-models-bitsandbytes
기타

이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.

스킬 보기