From 9fd2aaf94d15f5b11dc28f469909496a361fad71 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 29 Sep 2022 08:29:35 +0200 Subject: Adapt to new format of failed saem.mmkin fits --- R/illparms.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'R/illparms.R') diff --git a/R/illparms.R b/R/illparms.R index e4b28c56..c2f0263b 100644 --- a/R/illparms.R +++ b/R/illparms.R @@ -101,9 +101,12 @@ illparms.saem.mmkin <- function(object, conf.level = 0.95, random = TRUE, errmod #' @rdname illparms #' @export illparms.mhmkin <- function(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...) { + if (inherits(object[[1]], "saem.mmkin")) { + check_failed <- function(x) if (inherits(x$so, "try-error")) TRUE else FALSE + } result <- lapply(object, function(fit) { - if (inherits(fit, "try-error")) return("E") + if (check_failed(fit)) return("E") ill <- illparms(fit, conf.level = conf.level, random = random, errmod = errmod) if (length(ill) > 0) { return(paste(ill, collapse = ", ")) -- cgit v1.2.1