From cc17c1a74c9025ecc4900397d77b5dc00301660d Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 6 Dec 2023 15:36:52 +0100 Subject: [PATCH] use isTryError ancova --- R/ancova.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/ancova.R b/R/ancova.R index 91c28899..97952e39 100644 --- a/R/ancova.R +++ b/R/ancova.R @@ -994,7 +994,7 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) { postHocVarIndex = postHocVarIndex), silent = TRUE) - if (class(bootstrapPostHoc) == "try-error") { + if (jaspBase::isTryError(bootstrapPostHoc)) { postHocStandardContainer[[thisVarName]]$setError(bootstrapPostHoc) next } @@ -1342,7 +1342,7 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) { dunnettResult <- summary(dunnettFit)[["test"]] dunnettConfInt <- try(confint(dunnettFit, level = options$postHocCiLevel), silent = TRUE) - if (options$postHocCi && class(dunnettConfInt) == "try-error") { + if (options$postHocCi && jaspBase::isTryError(dunnettConfInt)) { postHocDunnettContainer$setError(gettext("Confidence interval is too narrow, please select a different confidence level.")) } else { dunnettResult <- data.frame(contrast = names(dunnettResult$coefficients), @@ -1587,7 +1587,7 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) { options = options, nRows = nRows, anovaFormula = anovaFormula), silent = TRUE) - if (class(bootstrapMarginalMeans) == "try-error") { + if (jaspBase::isTryError(bootstrapMarginalMeans)) { marginalMeansContainer[[thisVarName]]$setError(bootstrapMarginalMeans) next }