From b07f9fcb7468ac1b5fab0924328fba36ae943be5 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sun, 26 Nov 2023 20:38:30 +0100 Subject: Deal with 'saem' fits failing when updating an 'mhmkin' object --- R/status.R | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'R/status.R') diff --git a/R/status.R b/R/status.R index 8bcd3a16..f9d79e7d 100644 --- a/R/status.R +++ b/R/status.R @@ -74,15 +74,19 @@ print.status.mmkin <- function(x, ...) { status.mhmkin <- function(object, ...) { if (inherits(object[[1]], "saem.mmkin")) { test_func <- function(fit) { - if (inherits(fit$so, "try-error")) { - return("E") + if (inherits(fit, "try-error")) { + return("E") } else { - if (!is.null(fit$FIM_failed)) { - return_values <- c("fixed effects" = "Fth", - "random effects and error model parameters" = "FO") - return(paste(return_values[fit$FIM_failed], collapse = ", ")) + if (inherits(fit$so, "try-error")) { + return("E") } else { - return("OK") + if (!is.null(fit$FIM_failed)) { + return_values <- c("fixed effects" = "Fth", + "random effects and error model parameters" = "FO") + return(paste(return_values[fit$FIM_failed], collapse = ", ")) + } else { + return("OK") + } } } } -- cgit v1.2.1