A GitHub template for creating R packages with CI, testing, and standard project structure pre-configured.
Click Use this template on GitHub to create a new repo, then:
# Install devtools if needed
install.packages("devtools")
# Rename the package in DESCRIPTION
# Replace 'mypkg' with your package name throughout
# Install dependencies
devtools::install_deps()
# Run tests
devtools::test()
# Check the package
devtools::check().
├── DESCRIPTION # Package metadata — name, version, author, dependencies
├── NAMESPACE # Exports (auto-generated by roxygen2, do not edit by hand)
├── LICENSE
├── R/
│ └── hello.R # Example function — replace with your own
├── tests/
│ ├── testthat.R
│ └── testthat/
│ └── test-hello.R # Example tests using testthat
└── .github/
└── workflows/
└── blank.yml # R CMD Check CI across ubuntu/windows/macos × release/devel
DESCRIPTION— updatePackage,Title,Description,Authors@R, and anyImports/SuggestsR/— add your functions, one file per logical group, documented with roxygen2tests/testthat/— add test files namedtest-<filename>.RNAMESPACE— regenerate withdevtools::document()after updating roxygen2 docs
The included workflow runs R CMD check on Ubuntu, Windows, and macOS against both the current release and development versions of R on every push and pull request.