How to scaffold a proper R package
Quando usar: You're tired of hand-writing DESCRIPTION, NAMESPACE, and roxygen2 boilerplate.
Fluxo
-
ScaffoldUse Posit R-package skill. Create a new package 'tidylaundry' with 2 exported functions: wash() and fold().✓ Copiado→ Directory with DESCRIPTION, NAMESPACE, R/, tests/testthat/, README
-
Add roxygenAdd roxygen2 docs with @param, @return, @examples for each function.✓ Copiado→ Inline docs that devtools::document() converts to man/
-
Smoke testWrite testthat tests covering happy path + one edge case each.✓ Copiado→ Tests passing under devtools::test()
Resultado: A package that passes R CMD check on day one.
Armadilhas
- Generated code uses base R where tidyverse would be clearer (or vice versa) — State the style preference upfront