How saulo-chaves/probbreed works
Project type and purpose
• This is an open-source R package (“ProbBreed”) for Bayesian analysis of multi-environment trial data, implemented as an R library with embedded Stan models and C++ wrappers. It provides high-level R functions (bayes_met, extr_outs, prob_sup, plot) that internally invoke compiled Stan models via Rcpp/Rstan for inference, and then post-process results in R.
File structure
• Top-level:
• DESCRIPTION, NAMESPACE, LICENSE.md, NEWS.md, CRAN-SUBMISSION → R package metadata
• configure, configure.win → custom build scripts for Unix/Windows to locate Stan and Rcpp
• _pkgdown.yml, docs/, GitHub workflows → automated documentation and CI
• R/ directory → all user-facing R functions, S3 methods, and package initialization (ProbBreed-package.R, bayes_met.R, etc.)
• src/ directory → auto-generated C++ files (stanExports_*.cc/.h, RcppExports.cpp) and Makevars controlling compilation
• inst/stan/ → raw Stan model definitions (*.stan) plus include headers
• data/ → example datasets for maize and soy (.rda)
• man/ → Rd files and figure assets for help pages and vignettes
README for additional insights
• The README describes the main workflow:
a. bayes_met() fits one of nine Stan models to data → returns a stanfit object
b. extr_outs() extracts posterior summaries, variance components, PPCs → returns an “extr” object
c. prob_sup() computes marginal/pairwise probabilities of performance/stability → returns a “probsup” object
• External dependencies: Rcpp, rstan (Stan C++ compiler), devtools, pkgdown for docs
• CI workflows for R-CMD-check, pkgdown site build, coverage
Detailed capture of essential architectural elements
• That src/ files are auto-generated wrappers—not hand-written C++—to reflect the code generation pattern
• Configure scripts and Makevars to illustrate cross-platform build complexity
• Pkgdown site build and man/ directory as the documentation subsystem