aboutsummaryrefslogtreecommitdiff
path: root/R/mhmkin.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-09-29 08:29:35 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2022-09-29 08:29:35 +0200
commit9fd2aaf94d15f5b11dc28f469909496a361fad71 (patch)
treecdfa832a02ba40678e135f91ad37a49d318b7b48 /R/mhmkin.R
parent05df90d8328b804ad1efe92c81e9ace491b386ec (diff)
Adapt to new format of failed saem.mmkin fits
Diffstat (limited to 'R/mhmkin.R')
-rw-r--r--R/mhmkin.R16
1 files changed, 9 insertions, 7 deletions
diff --git a/R/mhmkin.R b/R/mhmkin.R
index a1475ef9..17c8a1f7 100644
--- a/R/mhmkin.R
+++ b/R/mhmkin.R
@@ -140,13 +140,15 @@ print.mhmkin <- function(x, ...) {
convergence.mhmkin <- function(object, ...) {
all_summary_warnings <- character()
- result <- lapply(object,
- function(fit) {
- if (inherits(fit, "try-error")) return("E")
- else {
- return("OK")
- }
- })
+ if (inherits(object[[1]], "saem.mmkin")) {
+ test_func <- function(fit) {
+ if (inherits(fit$so, "try-error")) return("E")
+ else return("OK")
+ }
+ } else {
+ stop("Only mhmkin objects containing saem.mmkin objects currently supported")
+ }
+ result <- lapply(object, test_func)
result <- unlist(result)
dim(result) <- dim(object)
dimnames(result) <- dimnames(object)

Contact - Imprint