diff options
author | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-03-28 07:11:13 +0100 |
---|---|---|
committer | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-03-28 07:11:13 +0100 |
commit | a789ea2ae74ae371476f0e1f035226d07a429a0b (patch) | |
tree | 506eaebe02ea86f32344d07edcfa5fa9e127db73 /inst/rmarkdown/templates/hierarchical_kinetics/skeleton | |
parent | 4f62f39b8979cb3a5c52d65d425e530dc0770665 (diff) |
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.Rmd | 2 |
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) |