R/holds hand-written analyses (*.b.R) and generated bases (*.h.R); helper utilities live alongside.jamovi/*.a|u|r.yamldefine options, UI, and results;jamovi/0000.yamlanchors shared references.tests/testthat/contains unit and integration coverage; mirror feature names astest-<feature>.R.- Documentation lives in
man/,vignettes/, and the pkgdown site underdocs/; metadata is inDESCRIPTIONandNAMESPACE. - Reusable datasets and fixtures belong in
data/(compressed.rda) ordata-raw/for generation scripts.
Rscript -e "devtools::document()"regenerates roxygen documentation before commits touchingR/.Rscript -e "devtools::test()"runs the full testthat suite; prefer focused files viatestthat::test_file().Rscript -e "devtools::check()"mirrors CI; use before release or structural changes.Rscript -e "pkgdown::build_site()"refreshes the docs site; run after editingvignettes/or roxygen examples.- Fast iterations:
Rscript -e "rcmdcheck::rcmdcheck(args = c('--no-manual'))"catches failures without rebuilding the manual.
- Follow tidyverse style: 2-space indents,
<-for assignment, snake_case objects, and ≤100-character lines. - Name analysis pairs as
analysis.b.Randanalysis.h.R; align option names with YAML definitions verbatim. - Use roxygen2 tags above exported functions; prefer
dplyrpipelines over deeply nested loops when practical. - Keep comments concise and functional; avoid describing obvious assignments.
- Write tests in
tests/testthat/test-<feature>.R; organize helpers inhelper-*.R. - Cover edge cases (single-level factors, missing values, seed-controlled simulations) and ensure deterministic snapshots.
- Validate tables with
expect_equal()or snapshot tests; assert plot objects viaexpect_s3_class()and layer checks.
- Commits use imperative verbs (
Add,Fix,Refactor) and focus on a single concern; avoid "WIP" labels. - PRs require a summary, linked issues (
Fixes #NNN), and screenshots for UI/plot updates; call out breaking changes explicitly. - Update documentation and tests in the same PR when behaviour shifts; note follow-up tasks in
TODO.mdif deferred.
- Never commit PHI/PII; anonymize inputs and rely on illustrative datasets in
inst/extdata/. - Respect CI parity: run
devtools::check()on macOS or Linux when possible to match GitHub Actions expectations.