aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2021-02-13 06:54:46 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2021-02-13 06:54:46 +0100
commit3532d769c1a3561de37e0d10cffa9801fe9df7c6 (patch)
tree5b303d77751897bbb151085181332457c35b0e6a /R/mkinfit.R
parent2ee20b257e34210e2d1f044431f3bfe059c9c5e7 (diff)
Update for gmkin 0.6.12v1.0.2
mkinfit: Keep model names stored in mkinmod objects, avoiding their loss in gmkin
Diffstat (limited to 'R/mkinfit.R')
-rw-r--r--R/mkinfit.R11
1 files changed, 9 insertions, 2 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index 704e70a9..4da39841 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -261,8 +261,15 @@ mkinfit <- function(mkinmod, observed,
summary_warnings <- character()
# Derive the name used for the model
- if (is.character(mkinmod)) mkinmod_name <- mkinmod
- else mkinmod_name <- deparse(substitute(mkinmod))
+ if (is.character(mkinmod)) {
+ mkinmod_name <- mkinmod
+ } else {
+ if (is.null(mkinmod$name)) {
+ mkinmod_name <- deparse(substitute(mkinmod))
+ } else {
+ mkinmod_name <- mkinmod$name
+ }
+ }
# Check mkinmod and generate a model for the variable whith the highest value
# if a suitable string is given

Contact - Imprint