Last updated: 2026-07-13
Checks: 7 0
Knit directory:
nonlinear-ge-interaction-shap/
This reproducible R Markdown analysis was created with workflowr (version 1.7.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20260713) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 6f375a8. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rproj.user/
Ignored: code/Codigo_SHAP_GE_10_07_23.txt
Ignored: data/Manuscript_MN_NE_ACCN.docx
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/analysis.Rmd) and HTML
(docs/analysis.html) files. If you’ve configured a remote
Git repository (see ?wflow_git_remote), click on the
hyperlinks in the table below to view the files as they were in that
past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 6f375a8 | WevertonGomesCosta | 2026-07-13 | Add initial reproducible analysis page |
This page presents the complete reproducible analytical workflow associated with the study “Non-Linear Modeling of Genotype × Environment Interaction via Tree-Based Learning Algorithms and Shapley Decomposition.”
The workflow combines phenotypic evaluation, Random Forest modeling, Shapley Additive Explanations, AMMI decomposition, stability indices, genotype ranking, and rank correlation.
All analytical code is presented directly in this R Markdown document and follows the order required to reproduce the analysis.
The global chunk options define how code, messages, warnings, tables, and figures are displayed throughout the analysis.
knitr::opts_chunk$set(
echo = TRUE,
warning = FALSE,
message = FALSE,
fig.align = "center",
fig.width = 9,
fig.height = 6
)
This section loads the packages required for data manipulation, machine learning, model interpretation, statistical analysis, and graphical visualization.
This section imports the original maize multi-environment trial data set stored in:
data/maize.txt
The original observations are summarized by genotype and environment before the machine-learning and interaction analyses.
This section presents the distribution of grain yield across the evaluated environments.
This section presents the distribution of grain yield across the evaluated genotypes.
The environmental index represents the mean grain-yield performance observed in each environment.
The Random Forest model is evaluated through leave-one-environment-out cross-validation.
Predictive performance is summarized using:
The final Random Forest model is fitted using the complete analytical data set.
A model explainer is created using the DALEX framework.
SHAP values are obtained for the genotype and environmental-index predictors.
Genotype-specific SHAP contributions are represented across environments.
The interaction matrix is obtained after removing genotype and environment main effects.
Singular value decomposition is applied to the genotype-by-environment interaction matrix.
The first two interaction principal components are extracted for genotypes and environments.
The AMMI biplot represents genotype scores and environmental vectors for the first two interaction principal components.
The AMMI biplot and genotype SHAP profiles are combined into a single graphical representation.
The AMMI Stability Value is calculated from the first two interaction principal components.
Mean genotype SHAP contribution and the standard deviation of genotype SHAP contributions are summarized for each genotype.
The Simultaneous Selection Index combines grain-yield and AMMI stability rankings.
Genotypes are compared according to:
A bump chart represents changes in genotype positions across the evaluated criteria.
The relationship between AMMI stability ranking and SHAP stability ranking is represented using a rank-concordance plot.
Spearman correlations are calculated among grain yield, AMMI stability, simultaneous selection, SHAP effect, and SHAP stability rankings.
The computational environment used to build the analysis is reported below.
sessionInfo()
R version 4.5.1 (2025-06-13 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8
[3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.utf8
time zone: America/Sao_Paulo
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] workflowr_1.7.2
loaded via a namespace (and not attached):
[1] vctrs_0.7.1 httr_1.4.7 cli_3.6.5 knitr_1.50
[5] rlang_1.1.7 xfun_0.54 stringi_1.8.7 otel_0.2.0
[9] processx_3.8.6 promises_1.5.0 jsonlite_2.0.0 glue_1.8.0
[13] rprojroot_2.1.1 git2r_0.36.2 htmltools_0.5.9 httpuv_1.6.16
[17] ps_1.9.1 sass_0.4.10 rmarkdown_2.30 jquerylib_0.1.4
[21] tibble_3.3.1 evaluate_1.0.5 fastmap_1.2.0 yaml_2.3.12
[25] lifecycle_1.0.5 whisker_0.4.1 stringr_1.6.0 compiler_4.5.1
[29] fs_1.6.6 pkgconfig_2.0.3 Rcpp_1.1.1 rstudioapi_0.17.1
[33] later_1.4.4 digest_0.6.39 R6_2.6.1 pillar_1.11.1
[37] callr_3.7.6 magrittr_2.0.4 bslib_0.9.0 tools_4.5.1
[41] cachem_1.1.0 getPass_0.2-4
sessionInfo()
R version 4.5.1 (2025-06-13 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8
[3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.utf8
time zone: America/Sao_Paulo
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] workflowr_1.7.2
loaded via a namespace (and not attached):
[1] vctrs_0.7.1 httr_1.4.7 cli_3.6.5 knitr_1.50
[5] rlang_1.1.7 xfun_0.54 stringi_1.8.7 otel_0.2.0
[9] processx_3.8.6 promises_1.5.0 jsonlite_2.0.0 glue_1.8.0
[13] rprojroot_2.1.1 git2r_0.36.2 htmltools_0.5.9 httpuv_1.6.16
[17] ps_1.9.1 sass_0.4.10 rmarkdown_2.30 jquerylib_0.1.4
[21] tibble_3.3.1 evaluate_1.0.5 fastmap_1.2.0 yaml_2.3.12
[25] lifecycle_1.0.5 whisker_0.4.1 stringr_1.6.0 compiler_4.5.1
[29] fs_1.6.6 pkgconfig_2.0.3 Rcpp_1.1.1 rstudioapi_0.17.1
[33] later_1.4.4 digest_0.6.39 R6_2.6.1 pillar_1.11.1
[37] callr_3.7.6 magrittr_2.0.4 bslib_0.9.0 tools_4.5.1
[41] cachem_1.1.0 getPass_0.2-4