Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →R package development with devtools, testthat, and roxygen2. Use when the user is working on an R package, running tests, writing documentation, or building package infrastructure.
.claude/skills/posit-dev-r-package-development/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 141% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -23% | 0% |
# Run code in the package
Rscript -e "devtools::load_all(); code"
# Run all tests
Rscript -e "devtools::test()"
# Run all tests for files starting with {name}
Rscript -e "devtools::test(filter = '^{name}')"
# Run all tests for R/{name}.R
Rscript -e "devtools::test_active_file('R/{name}.R')"
# Run a single test "blah" for R/{name}.R
Rscript -e "devtools::test_active_file('R/{name}.R', desc = 'blah')"
# Redocument the package
Rscript -e "devtools::document()"
# Check pkgdown documentation
Rscript -e "pkgdown::check_pkgdown()"
# Check the package with R CMD check
Rscript -e "devtools::check()"
# Format code
air format .air format . after generating code.|>) not the magrittr pipe (%>%).\() ... for single-line anonymous functions. For all other cases, use function() {...}.R/{name}.R go in tests/testthat/test-{name}.R.expect_true() and expect_false() in favour of a specific expectation which will give a better failure message.expect_error() or expect_warning(). Instead, use expect_snapshot(error = TRUE) for errors and expect_snapshot() for warnings because these allow the user to review the full text of the output._pkgdown.yml.pkgdown::check_pkgdown() to check that all topics are included in the reference index.NEWS.mdNEWS.md. Do not add bullets for small documentation changes or internal refactorings.(#123)..Other measured skills in the registry, with their headline benchmark lift.