aboutsummaryrefslogtreecommitdiff
path: root/inst/rmarkdown/templates/hierarchical_kinetics/skeleton
diff options
context:
space:
mode:
authorJohannes Ranke <johannes.ranke@jrwb.de>2025-03-28 07:11:13 +0100
committerJohannes Ranke <johannes.ranke@jrwb.de>2025-03-28 07:11:13 +0100
commita789ea2ae74ae371476f0e1f035226d07a429a0b (patch)
tree506eaebe02ea86f32344d07edcfa5fa9e127db73 /inst/rmarkdown/templates/hierarchical_kinetics/skeleton
parent4f62f39b8979cb3a5c52d65d425e530dc0770665 (diff)
Make parent model selection more robustHEADdev
In case one of the fits failed, the corresponding entry in `aic_parent` is `NA`, so we need to tell the `min()` function to ignore `NA` values instead of returning and empty result.
Diffstat (limited to 'inst/rmarkdown/templates/hierarchical_kinetics/skeleton')
-rw-r--r--inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd2
1 files changed, 1 insertions, 1 deletions
diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd
index a77908cb..f0692b4c 100644
--- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd
@@ -122,7 +122,7 @@ From the refined fits, the most suitable model is selected using the AIC.
```{r parent-best, dependson = "parent-mhmkin"}
aic_parent <- AIC(parent_mhmkin_refined)
-min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE)
+min_aic <- which(aic_parent == min(aic_parent, na.rm = TRUE), arr.ind = TRUE)
best_degmod_parent <- rownames(aic_parent)[min_aic[1]]
best_errmod_parent <- colnames(aic_parent)[min_aic[2]]
anova(parent_mhmkin_refined) |> kable(digits = 1)

Contact - Imprint