Skip to content

Commit

Permalink
Release fixes (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
FBartos authored Dec 15, 2023
1 parent 31cb4e2 commit ddd0c5f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions R/classicalpredictionperformance.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ClassicalPredictionPerformance <- function(jaspResults, dataset, options, stat


if (jaspBase::isTryError(fit))
jaspResults[["summaryTable"]]$setError(gettextf("metamisc package failed with the following error: '%s'", fit))
jaspResults[["summaryTable"]]$setError(gettextf("metamisc package failed with the following error: '%s'", .extractErrorMessage(fit)))

if (is.null(fit) || jaspResults[["summaryTable"]]$getError())
return()
Expand Down Expand Up @@ -357,39 +357,39 @@ ClassicalPredictionPerformance <- function(jaspResults, dataset, options, stat
if (is.null(fatFits[["M-FIV"]]) && options[["funnelPlotAsymmetryTestMacaskill"]])
fatFits[["M-FIV"]] <- try({
if (options[["numberOfParticipants"]] == "")
stop("The number of participants must be specified.", domain = NA)
stop("The number of participants must be specified.", call. = FALSE)
fitFat <- metamisc::fat(b = fit$data[,theta], b.se = fit$data[,theta.se], method = "M-FIV",
n.total = dataset[, options[["numberOfParticipants"]]])
if (is.na(fitFat$pval))
stop("The regression model could not be estimated.", domain = NA)
stop("The regression model could not be estimated.", call. = FALSE)
else
fitFat
})

if (is.null(fatFits[["M-FPV"]]) && options[["funnelPlotAsymmetryTestMacaskillPooled"]])
fatFits[["M-FPV"]] <- try({
if (options[["numberOfParticipants"]] == "")
stop("The number of participants must be specified.", domain = NA)
stop("The number of participants must be specified.", call. = FALSE)
else if (options[["numberOfObservedEvents"]] == "")
stop("The number of observed events must be specified.", domain = NA)
stop("The number of observed events must be specified.", call. = FALSE)
fitFat <- metamisc::fat(b = fit$data[,theta], b.se = fit$data[,theta.se], method = "M-FPV",
n.total = dataset[, options[["numberOfParticipants"]]], d.total = dataset[, options[["numberOfObservedEvents"]]])
if (is.na(fitFat$pval))
stop("The regression model could not be estimated.", domain = NA)
stop("The regression model could not be estimated.", call. = FALSE)
else
fitFat
})

if (is.null(fatFits[["P-FPV"]]) && options[["funnelPlotAsymmetryTestPeters"]])
fatFits[["P-FPV"]] <- try({
if (options[["numberOfParticipants"]] == "")
stop("The number of participants must be specified.", domain = NA)
stop("The number of participants must be specified.", call. = FALSE)
else if (options[["numberOfObservedEvents"]] == "")
stop("The number of observed events must be specified.", domain = NA)
stop("The number of observed events must be specified.", call. = FALSE)
fitFat <- metamisc::fat(b = fit$data[,theta], b.se = fit$data[,theta.se], method = "P-FPV",
n.total = dataset[, options[["numberOfParticipants"]]], d.total = dataset[, options[["numberOfObservedEvents"]]])
if (is.na(fitFat$pval))
stop("The regression model could not be estimated.", domain = NA)
stop("The regression model could not be estimated.", call. = FALSE)
else
fitFat
})
Expand All @@ -401,7 +401,7 @@ ClassicalPredictionPerformance <- function(jaspResults, dataset, options, stat
fitFat <- metamisc::fat(b = fit$data[,theta], b.se = fit$data[,theta.se], method = "D-FIV",
d.total = dataset[, options[["numberOfObservedEvents"]]])
if (is.na(fitFat$pval))
stop("The regression model could not be estimated.", domain = NA)
stop("The regression model could not be estimated.", call. = FALSE)
else
fitFat
})
Expand Down Expand Up @@ -446,7 +446,7 @@ ClassicalPredictionPerformance <- function(jaspResults, dataset, options, stat
))
funnelTestTable$addFootnote(gettextf("The %1$s test failed with the following error: %2$s",
.metamiscFitFunnelAsymmetryNames(names(fatFits)[i]),
fatFits[[i]]))
.extractErrorMessage(fatFits[[i]])))
} else {
funnelTestTable$addRows(list(
method = .metamiscFitFunnelAsymmetryNames(fatFits[[i]]$method),
Expand Down Expand Up @@ -561,7 +561,7 @@ ClassicalPredictionPerformance <- function(jaspResults, dataset, options, stat
yax <- unique(round(1/jaspGraphs::getPrettyAxisBreaks(range(yval, na.rm = TRUE))))
ylim <- range(c(yval, 1/yax))
} else {
stop("Plot not supported!", domain = NA)
stop("Plot is not supported.", call. = FALSE)
}

newdata <- sort(c(-max(x$model$data[, "x"]), x$model$data[,"x"], 2 * max(x$model$data[, "x"])))
Expand Down

0 comments on commit ddd0c5f

Please sign in to comment.