From 14a0246dad6664e8bb21f341f2baebacbdc5635c Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 27 Aug 2025 16:34:22 +0200 Subject: [PATCH 01/29] GUI --- inst/qml/processCapabilityStudies.qml | 125 ++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index 2bdbe463..7f01a050 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -273,6 +273,41 @@ Form id : normalCapabilityAnalysis label: qsTr("Normal distribution") checked: true + + + CheckBox + { + name: "historicalMean" + label: qsTr("Historical mean") + id: historicalMean + childrenOnSameRow: true + + DoubleField + { + name: "historicalMeanValue" + id: historicalMeanValue + negativeValues: true + defaultValue: 0 + decimals: 9 + } + } + + CheckBox + { + name: "historicalStdDev" + label: qsTr("Historical std. dev.") + id: historicalStdDev + childrenOnSameRow: true + + DoubleField + { + name: "historicalStdDevValue" + id: historicalStdDevValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } } RadioButton @@ -296,6 +331,96 @@ Form indexDefaultValue: 0 } + CheckBox + { + name: "historicalShape" + label: qsTr("Historical shape") + id: historicalShape + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalShapeValue" + id: historicalShapeValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalScale" + label: qsTr("Historical scale") + id: historicalScale + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalScaleValue" + id: historicalScaleValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalLogMean" + label: qsTr("Historical log mean") + id: historicalLogMean + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal" + + DoubleField + { + name: "historicalLogMeanValue" + id: historicalLogMeanValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalLogStdDev" + label: qsTr("Historical log std. dev.") + id: historicalLogStdDev + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal" + + DoubleField + { + name: "historicalLogStdDevValue" + id: historicalLogStdDevValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalThreshold" + label: qsTr("Historical threshold") + id: historicalThreshold + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "3ParameterLognormal" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalThresholdValue" + id: historicalThresholdValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + DropDown { name: "nonNormalMethod" From fcf075ec74a7ca7e8d1ecc626d5ed534a85171a6 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 20 Nov 2025 17:00:27 +0100 Subject: [PATCH 02/29] Functionality for normal dist. and historical mean --- R/processCapabilityStudies.R | 81 +++++++++++++++++------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index cbc10879..85030c4f 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -594,21 +594,23 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) if (is.na(sdw)) table$addFootnote(gettext("The within standard deviation could not be calculated.")) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + tableDfCurrentStage <- data.frame(lsl = round(options[["lowerSpecificationLimitValue"]], .numDecimals), target = round(options[["targetValue"]], .numDecimals), usl = round(options[["upperSpecificationLimitValue"]], .numDecimals), - mean = mean(allData, na.rm = TRUE), + mean = processMean, n = length(allData), sd = sd(allData, na.rm = TRUE), sdw = sdw) @@ -660,9 +662,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { target <- '*' if (!options[["upperSpecificationLimit"]]) usl <- '*' - mean <- mean(allData, na.rm = TRUE) - n <- as.integer(length(allData)) - sd <- sd(allData, na.rm = TRUE) formattedTableDf[["lsl"]] <- tableList[["lsl"]] formattedTableDf[["target"]] <- tableList[["target"]] formattedTableDf[["usl"]] <- tableList[["usl"]] @@ -736,11 +735,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- as.vector(na.omit(unlist(dataCurrentStage[, measurements]))) plotData <- data.frame(x = allData) @@ -772,20 +771,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # Overlay distribution if (options[["processCapabilityPlotDistributions"]]) { if (distribution == "normal") { - p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = mean(allData), sd = sd(allData)), - mapping = ggplot2::aes(color = "sdoDist", linetype = "sdoDist")) - legendColors <- c(legendColors, "dodgerblue") - legendLty <- c(legendLty, "solid") - legendLabels <- c(legendLabels, gettext("Normal dist.\n(std. dev. total)")) - + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) if (.qcWithinProcessValid(options)) { - p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = mean(allData), sd = sdw), - mapping = ggplot2::aes(color = "sdwDist", linetype = "sdwDist")) - legendColors <- c(legendColors, "red") - legendLty <- c(legendLty, "solid") - legendLabels <- c(legendLabels, gettext("Normal dist.\n(std. dev. within)")) + p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sd(allData)), + mapping = ggplot2::aes(color = "sdoDist", linetype = "sdoDist")) + + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sdw), + mapping = ggplot2::aes(color = "sdwDist", linetype = "sdwDist")) + legendColors <- c(legendColors, "dodgerblue", "red") + legendLty <- c(legendLty, "solid", "solid") + legendLabels <- c(legendLabels, gettext("Normal dist.\n(std. dev. total)"), + gettext("Normal dist.\n(std. dev. within)")) } - } else if (distribution == "weibull") { distParameters <- .distributionParameters(data = allData, distribution = distribution) if (jaspBase::isTryError(distParameters)) @@ -955,11 +951,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) @@ -968,10 +964,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { lsl <- options[["lowerSpecificationLimitValue"]] n <- length(allData) k <- length(measurements) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) tolMultiplier <- 6 cp <- if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) NA else (usl - lsl) / (tolMultiplier * sdw) - cpl <-if (options[["lowerSpecificationLimitBoundary"]]) NA else (mean(allData) - lsl) / ((tolMultiplier/2) * sdw) - cpu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - mean(allData)) / ((tolMultiplier/2) * sdw) + cpl <-if (options[["lowerSpecificationLimitBoundary"]]) NA else (processMean - lsl) / ((tolMultiplier/2) * sdw) + cpu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - processMean) / ((tolMultiplier/2) * sdw) if (options[["lowerSpecificationLimit"]] && options[["upperSpecificationLimit"]]) { cpk <-if (options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]]) NA else min(cpu, cpl, na.rm = TRUE) } else if (options[["lowerSpecificationLimit"]] && !options[["upperSpecificationLimit"]]) { @@ -1161,15 +1158,15 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) sdo <- sd(allData) - meanOverall <- mean(allData) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) usl <- options[["upperSpecificationLimitValue"]] lsl <- options[["lowerSpecificationLimitValue"]] m <- (options[["upperSpecificationLimitValue"]] + options[["lowerSpecificationLimitValue"]])/2 @@ -1177,8 +1174,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { t <- options[["targetValue"]] tolMultiplier <- 6 pp <- if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) NA else (usl - lsl) / (tolMultiplier * sdo) - ppl <- if (options[["lowerSpecificationLimitBoundary"]]) NA else (meanOverall - lsl) / ((tolMultiplier/2) * sdo) - ppu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - mean(allData)) / ((tolMultiplier/2) * sdo) + ppl <- if (options[["lowerSpecificationLimitBoundary"]]) NA else (processMean - lsl) / ((tolMultiplier/2) * sdo) + ppu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - processMean) / ((tolMultiplier/2) * sdo) if (options[["lowerSpecificationLimit"]] && options[["upperSpecificationLimit"]]) { ppk <- if (options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]]) NA else min(ppu, ppl, na.rm = TRUE) @@ -1222,7 +1219,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["target"]] && !(options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]])){ #CI for Cpm - a <- (meanOverall - t) / sdo + a <- (processMean - t) / sdo dfCpm <- (n * ((1 + (a^2))^2)) / (1 + (2 * (a^2))) ciLbCpm <- cpm * sqrt( qchisq(p = ciAlpha/2, df = dfCpm) /dfCpm) ciUbCpm <- cpm * sqrt(qchisq(p = 1 - (ciAlpha/2), df = dfCpm) / dfCpm) @@ -1357,7 +1354,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table2$addColumnInfo(name = expWithinComparisonColName, type = "integer", title = "Expected within", overtitle = colOvertitle2) } - #Calculate performance + # Calculate performance stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] allData <- na.omit(unlist(dataCurrentStage[, measurements])) @@ -1366,17 +1363,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { uslTitle <- if (options[["upperSpecificationLimitBoundary"]]) gettext("UB") else gettext("USL") rowNames <- c(sprintf("ppm < %s", lslTitle), sprintf("ppm > %s", uslTitle), "ppm total") sdo <- sd(allData) - meanOverall <- mean(allData) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } - #observed + # observed if (options[["lowerSpecificationLimit"]]) { oLSL <- (1e6*length(allDataVector[allDataVector < lsl])) / n } else { @@ -1392,12 +1389,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # expected total if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - eoLSL <- 1e6 * (1 - pnorm((meanOverall - lsl)/sdo)) + eoLSL <- 1e6 * (1 - pnorm((processMean - lsl)/sdo)) } else { eoLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - eoUSL <- 1e6 * (1 - pnorm((usl - meanOverall)/sdo)) + eoUSL <- 1e6 * (1 - pnorm((usl - processMean)/sdo)) } else { eoUSL <- NA } @@ -1406,12 +1403,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # expected within if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - ewLSL <- 1e6 * (1 - pnorm((meanOverall - lsl)/sdw)) + ewLSL <- 1e6 * (1 - pnorm((processMean - lsl)/sdw)) } else { ewLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - ewUSL <- 1e6 * (1 - pnorm((usl - meanOverall)/sdw)) + ewUSL <- 1e6 * (1 - pnorm((usl - processMean)/sdw)) } else { ewUSL <- NA } @@ -1531,7 +1528,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["upperSpecificationLimit"]]) table$addColumnInfo(name = "usl", type = "integer", title = uslTitle) table$addColumnInfo(name = "n", type = "integer", title = gettext("Sample size")) - table$addColumnInfo(name = "mean", type = "number", title = gettext("Average")) + table$addColumnInfo(name = "mean", type = "number", title = gettext("Mean")) table$addColumnInfo(name = "sd", type = "number", title = gettext("Std. dev.")) if (options[["nonNormalDistribution"]] == "3ParameterLognormal" | options[["nonNormalDistribution"]] == "lognormal") { table$addColumnInfo(name = "beta", type = "number", title = gettextf("Log mean (%1$s)", "\u03BC")) @@ -1582,12 +1579,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - mean <- mean(allData, na.rm = TRUE) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta tableDfCurrentStage <- data.frame("n" = n, - "mean" = mean, + "mean" = processMean, "sd" = sd, "lsl" = lsl, "usl" = usl, From 0f083f6b36b1b3672043180d03912835f8bb081a Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 21 Nov 2025 15:29:00 +0100 Subject: [PATCH 03/29] historical values in table for all non-normal dist --- R/processCapabilityStudies.R | 70 +++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 85030c4f..54221278 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1562,11 +1562,71 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] allData <- as.vector(na.omit(unlist(dataCurrentStage[, measurements]))) - distParameters[[i]] <- try(.distributionParameters(data = allData, distribution = options[["nonNormalDistribution"]])) - if (jaspBase::isTryError(distParameters[[i]])) { - table$setError(distParameters[[i]][1]) - container[["summaryTableNonNormal"]] <- table - return() + + # logic that checks if all parameters necessary for the distribution are given as historical, if yes, skip the dist. est. function, else replace only the given parameters + allParametersHistorical <- switch( + options[["nonNormalDistribution"]], + "weibull" = options[["historicalShape"]] && options[["historicalScale"]], + "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], + "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], + "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], + FALSE # default + ) + + + if (allParametersHistorical) { + if (allParametersHistorical) { # If all are historical, assign parameters as given in options + tempDistParamList <- switch( + options[["nonNormalDistribution"]], + "weibull" = list( + beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]] + ), + "lognormal" = list( + beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]] + ), + "3ParameterWeibull" = list( + beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]], + threshold = options[["historicalThresholdValue"]] + ), + "3ParameterLognormal" = list( + beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]], + threshold = options[["historicalThresholdValue"]] + ), + NULL + ) + distParameters[[i]] <- tempDistParamList + } + } else { # If not all are historical, first estimate all parameters, then potentially replace some with the historical estimates + distParameters[[i]] <- try(.distributionParameters(data = allData, distribution = options[["nonNormalDistribution"]])) + if (jaspBase::isTryError(distParameters[[i]])) { + table$setError(distParameters[[i]][1]) + container[["summaryTableNonNormal"]] <- table + return() + + ## If applicable, replace parameters with historical values + # Weibull and 3-parameter Weibull + if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { + if (options[["historicalShape"]]) + distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + + # Lognormal and 3-parameter Lognormal + } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { + if (options[["historicalLogMean"]]) + distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + } + } } } From a758414d07b5ebb07dc70ad61211e55fb4cc2fa8 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 1 Dec 2025 19:04:02 +0100 Subject: [PATCH 04/29] All functionality added --- R/commonQualityControl.R | 20 +++--- R/processCapabilityStudies.R | 128 +++++++++++++++++++++++++---------- 2 files changed, 103 insertions(+), 45 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 97f953ce..ecca85db 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1375,8 +1375,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { fit_Lnorm <- try(EnvStats::elnorm(data)) if (jaspBase::isTryError(fit_Lnorm)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Lnorm$parameters[1] - theta <- fit_Lnorm$parameters[2] + beta <- fit_Lnorm$parameters[1] # shape / logmean + theta <- fit_Lnorm$parameters[2] # scale / log std. dev. } else if (distribution == "weibull") { fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", control = list( @@ -1386,23 +1386,23 @@ KnownControlStats.RS <- function(N, sigma = 3) { ndeps = rep(1e-8, 2)))) if (jaspBase::isTryError(fit_Weibull)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Weibull$estimate[[1]] - theta <- fit_Weibull$estimate[[2]] + beta <- fit_Weibull$estimate[[1]] # shape + theta <- fit_Weibull$estimate[[2]] # scale } else if(distribution == "3ParameterLognormal") { temp <- try(EnvStats::elnorm3(data)) if (jaspBase::isTryError(temp)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$parameters[[1]] - theta <- temp$parameters[[2]] - threshold <- temp$parameters[[3]] + beta <- temp$parameters[[1]] # shape / logmean + theta <- temp$parameters[[2]] # scale / log std. dev. + threshold <- temp$parameters[[3]] # threshold } else if(distribution == "3ParameterWeibull") { temp <- try(MASS::fitdistr(data, function(x, shape, scale, thres) dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))) if (jaspBase::isTryError(temp)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$estimate[1] - theta <- temp$estimate[2] - threshold <- temp$estimate[3] + beta <- temp$estimate[1] # shape + theta <- temp$estimate[2] # scale + threshold <- temp$estimate[3] # threshold } else if (distribution == "exponential") { fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", fix.arg = list("shape" = 1), control = list(maxit = 500, abstol = .Machine$double.eps, reltol = .Machine$double.eps))) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 54221278..4ae42f17 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -768,6 +768,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c() legendLabels <- c() + # logic that checks if all parameters necessary for the non-normal distributions are given as historical, if yes, skip the dist. est. function, else replace only the given parameters + if (distribution != "normal") + allParametersHistorical <- switch( + options[["nonNormalDistribution"]], + "weibull" = options[["historicalShape"]] && options[["historicalScale"]], + "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], + "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], + "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], + FALSE # default + ) + # Overlay distribution if (options[["processCapabilityPlotDistributions"]]) { if (distribution == "normal") { @@ -783,9 +794,19 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { gettext("Normal dist.\n(std. dev. within)")) } } else if (distribution == "weibull") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalShape"]]) + distParameters$beta <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters$beta <- options[["historicalScaleValue"]] + } shape <- distParameters$beta scale <- distParameters$theta p <- p + ggplot2::stat_function(fun = dweibull, args = list(shape = shape, scale = scale), @@ -794,9 +815,19 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("Weibull dist.")) } else if (distribution == "lognormal") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalLogMean"]]) + distParameters$beta <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters$theta <- options[["historicalLogStdDevValue"]] + } shape <- distParameters$beta scale <- distParameters$theta p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = shape, sdlog = scale), @@ -805,10 +836,23 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, "Lognormal dist.") } else if (distribution == "3ParameterLognormal") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) - shape <- distParameters$theta + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]], + threshold = options[["historicalThresholdValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalLogMean"]]) + distParameters$beta <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters$theta <- options[["historicalLogStdDevValue"]] + if (options[["historicalThreshold"]]) + distParameters$threshold <- options[["historicalThresholdValue"]] + } + shape <- distParameters$theta # The distribution function uses theta for shape and beta for scale, which is reverse to convention scale <- distParameters$beta threshold <- distParameters$threshold p <- p + ggplot2::stat_function(fun = FAdist::dlnorm3 , args = list(shape = shape, scale = scale, thres = threshold), @@ -817,9 +861,22 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("3-parameter\nlognormal dist.")) } else if (distribution == "3ParameterWeibull") { + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]], + threshold = options[["historicalThresholdValue"]]) + } else { distParameters <- .distributionParameters(data = allData, distribution = distribution) if (jaspBase::isTryError(distParameters)) stop(distParameters[1], call. = FALSE) + if (options[["historicalShape"]]) + distParameters$beta <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters$beta <- options[["historicalScaleValue"]] + if (options[["historicalThreshold"]]) + distParameters$threshold <- options[["historicalThresholdValue"]] + } shape <- distParameters$beta scale <- distParameters$theta threshold <- distParameters$threshold @@ -1606,26 +1663,27 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table$setError(distParameters[[i]][1]) container[["summaryTableNonNormal"]] <- table return() + } - ## If applicable, replace parameters with historical values - # Weibull and 3-parameter Weibull - if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { - if (options[["historicalShape"]]) - distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] - if (options[["historicalScale"]]) - distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] - - # Lognormal and 3-parameter Lognormal - } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { - if (options[["historicalLogMean"]]) - distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] - if (options[["historicalLogStdDev"]]) - distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + ## If applicable, replace parameters with historical values + # Weibull and 3-parameter Weibull + if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { + if (options[["historicalShape"]]) { + distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] } + if (options[["historicalScale"]]) + distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + + # Lognormal and 3-parameter Lognormal + } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { + if (options[["historicalLogMean"]]) + distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] } } } @@ -1639,7 +1697,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + processMean <- mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta @@ -1810,12 +1868,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { if(options[['nonNormalMethod' ]] == "nonConformance") { - p1 <- FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) + p1 <- FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) # in this function, shape is theta and scale is beta, which is reverse to convention zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- FAdist::qlnorm3(p = 0.00135, shape = theta, scale = beta, thres = threshold) - x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) + x135 <- FAdist::qlnorm3(p = 0.00135, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention + x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention ppl <- (x05 - lsl) / (x05 - x135) } } else { @@ -1824,7 +1882,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { if(options[['nonNormalMethod' ]] == "nonConformance"){ - p2 <- FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold) + p2 <- FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention zUSL <- qnorm(p2) ppu <- zUSL/3 } else { @@ -2002,12 +2060,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { distname <- "3-parameter-lognormal" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - eoLSL <- 1e6 * FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) + eoLSL <- 1e6 * FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) # in this function, shape is theta and scale is beta, which is reverse to convention } else { eoLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - eoUSL <- 1e6 * (1 - FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold)) + eoUSL <- 1e6 * (1 - FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold)) # in this function, shape is theta and scale is beta, which is reverse to convention } else { eoUSL <- NA } From 8fa4bc6c88e3030a179620dd685d57117675a882 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Tue, 2 Dec 2025 16:26:58 +0100 Subject: [PATCH 05/29] Finalize historical params (before unit testing and verification) --- R/processCapabilityStudies.R | 59 ++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 4ae42f17..4a8025ea 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -557,6 +557,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { nStages <- length(unique(dataset[[stages]])) } table <- createJaspTable(title = gettext("Process summary")) + footnotes <- c() table$position <- 1 if (nStages > 1) { table$addColumnInfo(name = "stage", title = gettext("Stage"), type = "string") @@ -585,25 +586,31 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableColNames <- c("lsl", "target", "usl", "mean", "n", "sd", "sdw") if (nStages > 1) { tableColNames <- c("stage", tableColNames) - table$addFootnote(gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL).")) + footnotes <- paste0(footnotes, gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL). ")) } tableDf <- data.frame(matrix(ncol = length(tableColNames), nrow = 0)) colnames(tableDf) <- tableColNames for (i in seq_len(nStages)) { stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] - if (length(measurements) < 2) { - k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + + ## ----- Std. dev. calculation ---------- + if (options[["historicalStdDev"]]) { + sdw <- options[["historicalStdDevValue"]] } else { - sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" - unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + if (length(measurements) < 2) { + k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + } else { + sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" + unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + } + if (is.na(sdw)) + footnotes <- paste0(footnotes, gettext("The within std. dev. could not be calculated. ")) } - allData <- na.omit(unlist(dataCurrentStage[, measurements])) - if (is.na(sdw)) - table$addFootnote(gettext("The within standard deviation could not be calculated.")) + allData <- na.omit(unlist(dataCurrentStage[, measurements])) processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) @@ -633,6 +640,14 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableList <- as.list(tableDf) table$setData(tableList) + # Add remaining footnotes + if (options[["historicalStdDev"]]) + footnotes <- paste0(footnotes, gettext("The within std. dev. is based on a historical value. ")) + if (options[["historicalMean"]]) + footnotes <- paste0(footnotes, gettext("The mean is based on a historical value. ")) + if (!is.null(footnotes)) + table$addFootnote(footnotes) + nDecimals <- .numDecimals if (returnDataframe) { @@ -1556,10 +1571,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { nStages <- length(unique(dataset[[stages]])) } table <- createJaspTable(title = gettextf("Process summary")) + footnotes <- c() if (nStages > 1) { table$addColumnInfo(name = "stage", title = gettext("Stage"), type = "string") table$transpose <- TRUE - table$addFootnote(gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL).")) + footnotes <- paste0(footnotes, gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL). ")) } if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull") && @@ -1630,7 +1646,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { FALSE # default ) - if (allParametersHistorical) { if (allParametersHistorical) { # If all are historical, assign parameters as given in options tempDistParamList <- switch( @@ -2135,7 +2150,25 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { return(tableDf3) } - table$addFootnote(gettextf("Calculations based on %s distribution.", distname)) + # Add remaining footnotes + footnotes <- paste0(footnotes, gettextf("Calculations based on %s distribution.", distname)) + if (options[["historicalShape"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + footnotes <- paste0(footnotes, gettextf("The shape (%1$s) is based on a historical value. ", "\u03B2")) + if (options[["historicalScale"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + footnotes <- paste0(footnotes, gettextf("The scale (%1$s) is based on a historical value. ", "\u03B8")) + if (options[["historicalLogMean"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettextf("The log mean (%1$s) is based on a historical value. ", "\u03BC")) + if (options[["historicalLogStdDev"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettextf("The log std. dev. (%1$s) is based on a historical value. ", "\u03C3")) + if (options[["historicalThreshold"]] && (options[["nonNormalDistribution"]] == "3ParameterWeibull" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettext("The threshold is based on a historical value. ")) + + if (!is.null(footnotes)) + table$addFootnote(footnotes) + + + + container[["summaryTableNonNormal"]] <- table if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) table2$addFootnote(gettext("Statistics displayed as * were not calculated because the relevant specification limit is not set or set as boundary.")) From 4220fd224c319249cd822d02513a092038119d97 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 3 Dec 2025 16:19:52 +0100 Subject: [PATCH 06/29] New xaxis break rule and unit test updates --- R/processCapabilityStudies.R | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 4a8025ea..b74d8a7e 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -760,14 +760,29 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { plotData <- data.frame(x = allData) sdo <- sd(allData, na.rm = TRUE) - xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(plotData[["x"]], min(plotData[["x"]]) - 1 * sdo, max(plotData[["x"]]) + 1 * sdo), min.n = 4) - xLimits <- range(xBreaks) + xLimits <- c(min(allData) - sdo, max(allData) + sdo) if (options[["lowerSpecificationLimit"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["lowerSpecificationLimitValue"]]) + xLimits <- range(xLimits, options[["lowerSpecificationLimitValue"]] - 0.5*sdo) if (options[["upperSpecificationLimit"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["upperSpecificationLimitValue"]]) + xLimits <- range(xLimits, options[["upperSpecificationLimitValue"]] + 0.5*sdo) if (options[["target"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["target"]]) + xLimits <- range(xLimits, options[["targetValue"]]) + + if (distribution == "normal" && options[["historicalMean"]]) + xLimits <- range(xLimits, options[["historicalMeanValue"]] - 2 * sdo, options[["historicalMeanValue"]] + 2 * sdo) + # if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) + # xLimits <- range(xLimits, options[["historicalShapeValue"]]) + + + # Get xBreaks based on the data, with an axis that also spans the limits + xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(allData)) + xStep <- diff(xBreaks)[1] + loExt <- min(xBreaks) - pmax(0, ceiling((min(xBreaks) - min(xLimits)) / xStep) * xStep) + hiExt <- max(xBreaks) + pmax(0, ceiling((max(xLimits) - max(xBreaks)) / xStep) * xStep) + xBreaks <- seq(loExt, hiExt, by = xStep) + # Get limits to always include all breaks + xLimits <- range(xLimits, xBreaks) + nBins <- options[["processCapabilityPlotBinNumber"]] h <- hist(allData, plot = FALSE, breaks = nBins) From 44002398fc4408ede501f5b93841d036cf07a14e Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 3 Dec 2025 16:36:54 +0100 Subject: [PATCH 07/29] Rule to consider hist. dist. in xlimits --- R/processCapabilityStudies.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index b74d8a7e..44c08300 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -768,11 +768,16 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["target"]] && options[["processCapabilityPlotSpecificationLimits"]]) xLimits <- range(xLimits, options[["targetValue"]]) + # Addition to consider that if distributions are set historically, they may fall outside the usual limits if (distribution == "normal" && options[["historicalMean"]]) - xLimits <- range(xLimits, options[["historicalMeanValue"]] - 2 * sdo, options[["historicalMeanValue"]] + 2 * sdo) - # if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) - # xLimits <- range(xLimits, options[["historicalShapeValue"]]) - + xLimits <- range(xLimits, options[["historicalMeanValue"]] - 1.5 * sdo, options[["historicalMeanValue"]] + 1.5 * sdo) + if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) { + weibullCenterEstimate <- sdo * (options[["historicalShapeValue"]] + 1) + xLimits <- range(xLimits, weibullCenterEstimate - 1.5 * sdo, weibullCenterEstimate + 1.5 * sdo) + } + if (distribution == "lognormal" || distribution == "3ParameterLognormal" && options[["historicalLogMean"]]) + xLimits <- range(xLimits, exp(options[["historicalLogMeanValue"]]) - 1.5 * sdo, + exp(options[["historicalLogMeanValue"]]) + 1.5 * sdo) # Get xBreaks based on the data, with an axis that also spans the limits xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(allData)) From 6ba1ba6280ccff87bd42d7cb457bc2219f7bd224 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 4 Dec 2025 17:59:17 +0100 Subject: [PATCH 08/29] Unit tests part 1 --- R/processCapabilityStudies.R | 6 +- ...capability-of-the-processl25-subplot-1.svg | 100 ++++ ...capability-of-the-processl26-subplot-1.svg | 100 ++++ ...capability-of-the-processl27-subplot-1.svg | 156 ++++++ ...capability-of-the-processl28-subplot-1.svg | 94 ++++ ...capability-of-the-processl29-subplot-1.svg | 94 ++++ ...capability-of-the-processl30-subplot-1.svg | 98 ++++ ...capability-of-the-processl31-subplot-1.svg | 94 ++++ ...capability-of-the-processl32-subplot-1.svg | 94 ++++ ...capability-of-the-processl33-subplot-1.svg | 178 +++++++ .../testthat/test-processCapabilityStudies.R | 483 ++++++++++++++++++ 11 files changed, 1493 insertions(+), 4 deletions(-) create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 44c08300..e9e669fb 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -771,10 +771,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # Addition to consider that if distributions are set historically, they may fall outside the usual limits if (distribution == "normal" && options[["historicalMean"]]) xLimits <- range(xLimits, options[["historicalMeanValue"]] - 1.5 * sdo, options[["historicalMeanValue"]] + 1.5 * sdo) - if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) { - weibullCenterEstimate <- sdo * (options[["historicalShapeValue"]] + 1) - xLimits <- range(xLimits, weibullCenterEstimate - 1.5 * sdo, weibullCenterEstimate + 1.5 * sdo) - } + if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalScale"]]) + xLimits <- range(xLimits, options[["historicalScaleValue"]] - 1.5 * sdo, options[["historicalScaleValue"]] + 1.5 * sdo) if (distribution == "lognormal" || distribution == "3ParameterLognormal" && options[["historicalLogMean"]]) xLimits <- range(xLimits, exp(options[["historicalLogMeanValue"]]) - 1.5 * sdo, exp(options[["historicalLogMeanValue"]]) + 1.5 * sdo) diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg new file mode 100644 index 00000000..0ae80ded --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL25-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg new file mode 100644 index 00000000..9d480fb4 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL26-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg new file mode 100644 index 00000000..df2918c5 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL27-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg new file mode 100644 index 00000000..5810bf96 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL28-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg new file mode 100644 index 00000000..bd82ac24 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL29-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg new file mode 100644 index 00000000..79331f06 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL30-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg new file mode 100644 index 00000000..1738c948 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL31-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg new file mode 100644 index 00000000..d586ae16 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL32-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg new file mode 100644 index 00000000..a8109edb --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL33-subplot-1 + + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index 7d3fbbea..2dea7f71 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -1708,6 +1708,489 @@ test_that("LF24 (Normal) Basic test of report functionality with removed element jaspTools::expect_equal_plots(testPlot, "process-capability-report24") }) + +## Test of historical parameter settings #### + +### Normal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 6 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF25.1 Normal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL25") +}) + +test_that("LF25.2 Normal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.83, 1.04, 1.08, 1.08, 0.94, 1.21, 1.08, 0.95, 1.08, 1.2 + )) +}) + +test_that("LF25.3 Normal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(614.34, 586.56, 0, "ppm < LSL", 614.34, 586.56, 10000, "ppm > USL", + 1228.68, 1173.12, 10000, "ppm total")) +}) + +test_that("LF25.4 Normal distribution with one historical param. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.08, 1.08, 0.94, 1.23, 1.08, 0.94, 1.08, 1.22)) +}) + +test_that("LF25.5 Normal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 6, 100, 1.85635681000733, 1.84880707556386, 6, 12)) +}) + +### Normal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 6 +options$historicalStdDev <- TRUE +options$historicalStdDevValue <- 3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF26.1 Normal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL26") +}) + +test_that("LF26.2 Normal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.83, 1.04, 1.08, 1.08, 0.94, 1.21, 1.08, 0.95, 1.08, 1.2 + )) +}) + +test_that("LF26.3 Normal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(614.34, 22750.13, 0, "ppm < LSL", 614.34, 22750.13, 10000, + "ppm > USL", 1228.68, 45500.26, 10000, "ppm total")) +}) + +test_that("LF26.4 Normal distribution with all historical param. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.67, 0.67, 0.57, 0.77, 0.67, 0.58, 0.67, 0.75)) +}) + +test_that("LF26.5 Normal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 6, 100, 1.85635681000733, 3, 6, 12)) +}) + +### Normal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 40 +options$historicalStdDev <- TRUE +options$historicalStdDevValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF27.1 Normal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL27") +}) + +test_that("LF27.2 Normal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.93, 0.94, 1.08, -5.03, -5.62, -4.44, 7.18, 0.95, -5.03, + 1.2)) +}) + +test_that("LF27.3 Normal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 3830.38, 0, "ppm < LSL", 1e+06, 969025.92, 10000, "ppm > USL", + 1e+06, 972856.3, 10000, "ppm total")) +}) + +test_that("LF27.4 Normal distribution with mismatching historical dist. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.13, -0.62, -0.72, -0.53, 0.89, 0.12, -0.62, 0.15)) +}) + +test_that("LF27.5 Normal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 40, 100, 1.85635681000733, 15, 6, 12)) +}) + +### Weibull distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 6 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF28.1 Weibull distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 1.53, 10000, "ppm > USL", 1.53, 10000, + "Total ppm")) +}) + +test_that("LF28.2 Weibull distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL28") +}) + +test_that("LF28.3 Weibull distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 1.56, "", 1.56)) +}) + +test_that("LF28.4 Weibull distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(6, 0, 7.08, 100, 1.85635681000733, 6, 7.78727631111372, 12)) +}) + +### Weibull distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 6 +options$historicalScale <- TRUE +options$historicalScaleValue <- 10 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF29.1 Weibull distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 50489.8, 10000, "ppm > USL", 50489.8, + 10000, "Total ppm")) +}) + +test_that("LF29.2 Weibull distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL29") +}) + +test_that("LF29.3 Weibull distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.55, "", 0.55)) +}) + +test_that("LF29.4 Weibull distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(6, 0, 7.08, 100, 1.85635681000733, 6, 10, 12)) +}) + +### Weibull distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 40 +options$historicalScale <- TRUE +options$historicalScaleValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF30.1 Weibull distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 999867.09, 10000, "ppm > USL", 999867.09, + 10000, "Total ppm")) +}) + +test_that("LF30.2 Weibull distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL30") +}) + +test_that("LF30.3 Weibull distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.22, "", -1.22)) +}) + +test_that("LF30.4 Weibull distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(40, 0, 7.08, 100, 1.85635681000733, 6, 15, 12)) +}) + +### Lognormal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF31.1 Lognormal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 37860.93, 10000, "ppm > USL", 37860.93, + 10000, "Total ppm")) +}) + +test_that("LF31.2 Lognormal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL31") +}) + +test_that("LF31.3 Lognormal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.59, "", 0.59)) +}) + +test_that("LF31.4 Lognormal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.273022707246043, 12)) +}) + +### Lognormal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF32.1 Lognormal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 53008.74, 10000, "ppm > USL", 53008.74, + 10000, "Total ppm")) +}) + +test_that("LF32.2 Lognormal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL32") +}) + +test_that("LF32.3 Lognormal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.54, "", 0.54)) +}) + +test_that("LF32.4 Lognormal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.3, 12)) +}) + +### Lognormal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 4 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.5 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF33.1 Lognormal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 998777.99, 10000, "ppm > USL", 998777.99, + 10000, "Total ppm")) +}) + +test_that("LF33.2 Lognormal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL33") +}) + +test_that("LF33.3 Lognormal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.01, "", -1.01)) +}) + +test_that("LF33.4 Lognormal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 0, 7.08, 100, 1.85635681000733, 6, 0.5, 12)) +}) + +### 3-Parameter-Weibull distribution with one historical param. (verified with other software) #### + +### 3-Parameter-Weibull distribution with all historical param. (verified with other software) #### + +### 3-Parameter-Weibull distribution with mismatching historical dist. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with one historical param. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with all historical param. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with mismatching historical dist. (verified with other software) #### + # Wide / Row format #### ## (Normal) Basic tests #### From e93c8582c33fb1caf73118e0935e11b73a2e6660 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 5 Dec 2025 16:46:14 +0100 Subject: [PATCH 09/29] Finalize unit tests and add help files --- inst/help/processCapabilityStudies.md | 1 + ...capability-of-the-processl34-subplot-1.svg | 94 ++++++ ...capability-of-the-processl35-subplot-1.svg | 94 ++++++ ...capability-of-the-processl36-subplot-1.svg | 98 ++++++ ...capability-of-the-processl37-subplot-1.svg | 95 ++++++ ...capability-of-the-processl38-subplot-1.svg | 99 ++++++ ...capability-of-the-processl39-subplot-1.svg | 179 +++++++++++ .../testthat/test-processCapabilityStudies.R | 300 ++++++++++++++++++ 8 files changed, 960 insertions(+) create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg diff --git a/inst/help/processCapabilityStudies.md b/inst/help/processCapabilityStudies.md index c622718b..2a3dca87 100644 --- a/inst/help/processCapabilityStudies.md +++ b/inst/help/processCapabilityStudies.md @@ -49,6 +49,7 @@ The size of the subgroups is relevant for the calculation of the process varianc - Type of data distribution: indicate whether the data approximates a normal distribution or another distribution (the most commonly used distributions are: Weibull, Lognormal, 3-parameter Weibull, and 3-parameter lognorma) - Specify a distribution: the non-normal distribution to be used. - Non-normal capability statistics: the method used to calculate the capability statistics for non-normally distributed data. + - Historical parameters: Select which parameters should use fixed historical values instead of being estimated. Note that if only some parameters are set historically, JASP currently estimates all parameters first and then replaces the selected ones with their historical values; it does not keep them fixed during estimation. #### Capability studies - Specification limits: diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg new file mode 100644 index 00000000..ff67e093 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL34-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg new file mode 100644 index 00000000..3abb31eb --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL35-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg new file mode 100644 index 00000000..98d560c2 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL36-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg new file mode 100644 index 00000000..8b418dc9 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL37-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg new file mode 100644 index 00000000..5006e982 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL38-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg new file mode 100644 index 00000000..060becd6 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL39-subplot-1 + + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index 2dea7f71..3f7a05e8 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -2180,16 +2180,316 @@ test_that("LF33.4 Lognormal distribution with mismatching historical dist. - Pro }) ### 3-Parameter-Weibull distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF34.1 3ParameterWeibull distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 11678.25, 10000, "ppm > USL", 11678.25, + 10000, "Total ppm")) +}) + +test_that("LF34.2 3ParameterWeibull distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL34") +}) + +test_that("LF34.3 3ParameterWeibull distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.76, "", 0.76)) +}) + +test_that("LF34.4 3ParameterWeibull distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.64846838111814, 0, 7.08, 100, 1.85635681000733, 6, 5.1219561122954, + 3, 12)) +}) ### 3-Parameter-Weibull distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +options$historicalShape <- TRUE +options$historicalShapeValue <- 2.5 +options$historicalScale <- TRUE +options$historicalScaleValue <- 5 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF35.1 3ParameterWeibull distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 12946.68, 10000, "ppm > USL", 12946.68, + 10000, "Total ppm")) +}) + +test_that("LF35.2 3ParameterWeibull distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL35") +}) + +test_that("LF35.3 3ParameterWeibull distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.74, "", 0.74)) +}) + +test_that("LF35.4 3ParameterWeibull distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.5, 0, 7.08, 100, 1.85635681000733, 6, 5, 3, 12)) +}) ### 3-Parameter-Weibull distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +options$historicalShape <- TRUE +options$historicalShapeValue <- 16 +options$historicalScale <- TRUE +options$historicalScaleValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF36.1 3ParameterWeibull distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 999717.93, 10000, "ppm > USL", 999717.93, + 10000, "Total ppm")) +}) + +test_that("LF36.2 3ParameterWeibull distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL36") +}) + +test_that("LF36.3 3ParameterWeibull distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.15, "", -1.15)) +}) + +test_that("LF36.4 3ParameterWeibull distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(16, 0, 7.08, 100, 1.85635681000733, 6, 15, 3, 12)) +}) ### 3-Parameter-Lognormal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF37.1 3ParameterLognormal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.12, 0, "ppm < LSL", 9380.21, 10000, "ppm > USL", 9380.33, + 10000, "Total ppm")) +}) + +test_that("LF37.2 3ParameterLognormal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL37") +}) + +test_that("LF37.3 3ParameterLognormal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.25, 0.78, 1.72, 0.78)) +}) + +test_that("LF37.4 3ParameterLognormal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.70930280255199, 0, 7.08, 100, 1.85635681000733, 6, 0.121871527001624, + -8, 12)) +}) ### 3-Parameter-Lognormal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2.7 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF38.1 3ParameterLognormal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.12, 0, "ppm < LSL", 6861.46, 10000, "ppm > USL", 6861.58, + 10000, "Total ppm")) +}) + +test_that("LF38.2 3ParameterLognormal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL38") +}) + +test_that("LF38.3 3ParameterLognormal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.27, 0.82, 1.72, 0.82)) +}) + +test_that("LF38.4 3ParameterLognormal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.7, 0, 7.08, 100, 1.85635681000733, 6, 0.12, -8, 12)) +}) ### 3-Parameter-Lognormal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 4 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF39.1 3ParameterLognormal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 1e+06, 10000, "ppm > USL", 1e+06, 10000, + "Total ppm")) +}) + +test_that("LF39.2 3ParameterLognormal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL39") +}) + +test_that("LF39.3 3ParameterLognormal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.27, -2.79, 5.33, -2.79)) +}) + +test_that("LF39.4 3ParameterLognormal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 0, 7.08, 100, 1.85635681000733, 6, 0.12, -8, 12)) +}) # Wide / Row format #### From 40550f4d36bca6cb24f8e16a5d793b27578ae6ea Mon Sep 17 00:00:00 2001 From: JTPetter Date: Tue, 6 Jan 2026 17:32:51 +0100 Subject: [PATCH 10/29] Update unit tests after merging (x-axis changes and ggplot update together) --- .../capability-of-the-process1-subplot-1.svg | 88 +++--- .../capability-of-the-process12-subplot-1.svg | 80 ++--- .../capability-of-the-process12-subplot-2.svg | 80 ++--- .../capability-of-the-process12-subplot-3.svg | 88 +++--- .../capability-of-the-process13-subplot-1.svg | 82 ++--- .../capability-of-the-process13-subplot-2.svg | 88 +++--- .../capability-of-the-process14-subplot-1.svg | 88 +++--- .../capability-of-the-process16-subplot-1.svg | 88 +++--- .../capability-of-the-process17-subplot-1.svg | 88 +++--- .../capability-of-the-process18-subplot-1.svg | 88 +++--- .../capability-of-the-process19-subplot-1.svg | 88 +++--- .../capability-of-the-process2-subplot-1.svg | 82 ++--- .../capability-of-the-process2-subplot-2.svg | 88 +++--- .../capability-of-the-process20-subplot-1.svg | 80 ++--- .../capability-of-the-process20-subplot-2.svg | 106 ++++--- .../capability-of-the-process20-subplot-3.svg | 88 +++--- .../capability-of-the-process3-subplot-1.svg | 88 +++--- .../capability-of-the-process4-subplot-1.svg | 82 ++--- .../capability-of-the-process4-subplot-2.svg | 88 +++--- .../capability-of-the-process5-subplot-1.svg | 78 ++--- .../capability-of-the-process5-subplot-2.svg | 86 +++--- .../capability-of-the-process6-subplot-1.svg | 78 ++--- .../capability-of-the-process6-subplot-2.svg | 86 +++--- .../capability-of-the-process7-subplot-1.svg | 78 ++--- .../capability-of-the-process7-subplot-2.svg | 86 +++--- .../capability-of-the-process8-subplot-1.svg | 80 ++--- .../capability-of-the-process8-subplot-2.svg | 86 +++--- .../capability-of-the-process9-subplot-1.svg | 82 ++--- .../capability-of-the-process9-subplot-2.svg | 88 +++--- ...capability-of-the-processl25-subplot-1.svg | 120 ++++---- ...capability-of-the-processl26-subplot-1.svg | 120 ++++---- ...capability-of-the-processl27-subplot-1.svg | 232 +++++++------- ...capability-of-the-processl28-subplot-1.svg | 118 ++++---- ...capability-of-the-processl29-subplot-1.svg | 118 ++++---- ...capability-of-the-processl30-subplot-1.svg | 126 ++++---- ...capability-of-the-processl31-subplot-1.svg | 118 ++++---- ...capability-of-the-processl32-subplot-1.svg | 118 ++++---- ...capability-of-the-processl33-subplot-1.svg | 286 +++++++++--------- ...capability-of-the-processl34-subplot-1.svg | 118 ++++---- ...capability-of-the-processl35-subplot-1.svg | 118 ++++---- ...capability-of-the-processl36-subplot-1.svg | 126 ++++---- ...capability-of-the-processl37-subplot-1.svg | 118 ++++---- ...capability-of-the-processl38-subplot-1.svg | 126 ++++---- ...capability-of-the-processl39-subplot-1.svg | 286 +++++++++--------- .../capability-of-the-processw1-subplot-1.svg | 88 +++--- ...capability-of-the-processw10-subplot-1.svg | 82 ++--- ...capability-of-the-processw10-subplot-2.svg | 80 ++--- ...capability-of-the-processw10-subplot-3.svg | 106 ++++--- ...capability-of-the-processw12-subplot-1.svg | 88 +++--- ...capability-of-the-processw14-subplot-1.svg | 88 +++--- ...capability-of-the-processw15-subplot-1.svg | 88 +++--- .../capability-of-the-processw2-subplot-1.svg | 80 ++--- .../capability-of-the-processw2-subplot-2.svg | 88 +++--- .../capability-of-the-processw3-subplot-1.svg | 86 +++--- .../capability-of-the-processw4-subplot-1.svg | 86 +++--- .../capability-of-the-processw5-subplot-1.svg | 86 +++--- .../capability-of-the-processw6-subplot-1.svg | 86 +++--- .../capability-of-the-processw7-subplot-1.svg | 88 +++--- .../process-capability-report21-subplot-7.svg | 88 +++--- .../process-capability-report22-subplot-4.svg | 88 +++--- .../process-capability-report22-subplot-9.svg | 82 ++--- .../process-capability-report23-subplot-4.svg | 86 +++--- .../process-capability-report23-subplot-9.svg | 78 ++--- .../process-capability-report24-subplot-5.svg | 88 +++--- ...process-capability-reportw16-subplot-7.svg | 88 +++--- ...process-capability-reportw17-subplot-4.svg | 88 +++--- ...process-capability-reportw17-subplot-9.svg | 80 ++--- ...process-capability-reportw18-subplot-4.svg | 86 +++--- ...process-capability-reportw18-subplot-9.svg | 78 ++--- ...process-capability-reportw19-subplot-5.svg | 88 +++--- 70 files changed, 3609 insertions(+), 3353 deletions(-) diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg index 40a91102..f46e5052 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg index 2a1e8a78..edd35704 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg index d44f3bb2..6fe3ca75 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg index 8b92e12d..7ec006fc 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg index d26285d4..94bb8a1c 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg index 6c50e0cd..8ceb610c 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg index 3fc9d281..3293dae6 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg index 0ec3e000..8a9364dc 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg index dd5e730c..0b5ce1b1 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg index 8510c300..9ac0e38a 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LB = 0 - -UB = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LB = 0 + +UB = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg index b8318cd2..c95a9886 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg index 02157e07..ab6bd8ee 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg index 7a5d44da..453ee6e7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg index 4fdb5fd5..396b9417 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg index 49c35f6f..455263a9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg @@ -27,60 +27,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + Target = 6 - -LSL = 0 - -USL = 12 - + +LSL = 0 + +USL = 12 + - - + + + + + + + - - + + + + + + -2 -4 +-1 +0 +1 +2 +3 +4 +5 6 -8 -10 -12 +7 +8 +9 +10 +11 +12 +13 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg index 37828025..0c94e727 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg index ed22ec6d..5ab30553 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg index 02157e07..ab6bd8ee 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg index 7a5d44da..453ee6e7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg index deaf8dec..9d74dd89 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg index d0e10056..30347642 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg index 2ff175aa..128975ac 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg index be35a8c3..831d2f50 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg index c8c61a6d..ad40ffac 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg index 34466f88..8e6fa98a 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg index 861ad7fa..7f9c6823 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg @@ -27,52 +27,56 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg index dcbeffbd..bfe86ced 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg index 7618632a..0e92588f 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg index 7a5d44da..453ee6e7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg index 0ae80ded..e849f363 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg @@ -21,69 +21,69 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density @@ -95,6 +95,6 @@ (std. dev. total) Normal dist. (std. dev. within) -capability-of-the-processL25-subplot-1 +capability-of-the-processL25-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg index 9d480fb4..a267ca98 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg @@ -21,69 +21,69 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density @@ -95,6 +95,6 @@ (std. dev. total) Normal dist. (std. dev. within) -capability-of-the-processL26-subplot-1 +capability-of-the-processL26-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg index df2918c5..f871b899 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg @@ -21,125 +21,125 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -20 -22 -24 -26 -28 -30 -32 -34 -36 -38 -40 -42 -44 -Measurement + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +Measurement Density @@ -151,6 +151,6 @@ (std. dev. total) Normal dist. (std. dev. within) -capability-of-the-processL27-subplot-1 +capability-of-the-processL27-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg index 5810bf96..27b6e1f6 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density Weibull dist. -capability-of-the-processL28-subplot-1 +capability-of-the-processL28-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg index bd82ac24..cd4e1124 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density Weibull dist. -capability-of-the-processL29-subplot-1 +capability-of-the-processL29-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg index 79331f06..880231a1 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg @@ -21,78 +21,78 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -Measurement + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement Density Weibull dist. -capability-of-the-processL30-subplot-1 +capability-of-the-processL30-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg index 1738c948..07c141b6 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density Lognormal dist. -capability-of-the-processL31-subplot-1 +capability-of-the-processL31-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg index d586ae16..9dc3ed26 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density Lognormal dist. -capability-of-the-processL32-subplot-1 +capability-of-the-processL32-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg index a8109edb..5501668d 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg @@ -21,158 +21,158 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -20 -22 -24 -26 -28 -30 -32 -34 -36 -38 -40 -42 -44 -46 -48 -50 -52 -54 -56 -58 -Measurement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement Density Lognormal dist. -capability-of-the-processL33-subplot-1 +capability-of-the-processL33-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg index ff67e093..360c0b6a 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density 3-parameter Weibull dist. -capability-of-the-processL34-subplot-1 +capability-of-the-processL34-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg index 3abb31eb..43439b61 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg @@ -21,74 +21,74 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density 3-parameter Weibull dist. -capability-of-the-processL35-subplot-1 +capability-of-the-processL35-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg index 98d560c2..fefafec9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg @@ -21,78 +21,78 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -Measurement + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement Density 3-parameter Weibull dist. -capability-of-the-processL36-subplot-1 +capability-of-the-processL36-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg index 8b418dc9..e8afcfbc 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg @@ -21,68 +21,68 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -Measurement + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement Density @@ -90,6 +90,6 @@ 3-parameter lognormal dist. -capability-of-the-processL37-subplot-1 +capability-of-the-processL37-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg index 5006e982..b79190e4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg @@ -21,72 +21,72 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -Measurement + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement Density @@ -94,6 +94,6 @@ 3-parameter lognormal dist. -capability-of-the-processL38-subplot-1 +capability-of-the-processL38-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg index 060becd6..528e9ad9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg @@ -21,152 +21,152 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -20 -22 -24 -26 -28 -30 -32 -34 -36 -38 -40 -42 -44 -46 -48 -50 -52 -54 -56 -58 -Measurement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement Density @@ -174,6 +174,6 @@ 3-parameter lognormal dist. -capability-of-the-processL39-subplot-1 +capability-of-the-processL39-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg index 9b1d8e4f..fe7c0eb4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg index 94743391..40f2d99b 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg index d6495cb9..8393cbb7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg index aaa81c11..f8699a62 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg @@ -27,60 +27,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + Target = 6 - -LSL = 0 - -USL = 12 - + +LSL = 0 + +USL = 12 + - - + + + + + + + - - + + + + + + -2 -4 +-1 +0 +1 +2 +3 +4 +5 6 -8 -10 -12 +7 +8 +9 +10 +11 +12 +13 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg index 4f45321b..52e36757 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg index dc780d28..55d47db6 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LB = 0 - -UB = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LB = 0 + +UB = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg index 3bd3b985..dd9c022a 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg index 111a54ee..c7b99a7d 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg index 14b714d2..08fbb156 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg index f0c1670d..d6266694 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg index b109e7cb..bb7ecbc9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg index 0acdac8c..8bb7e1c7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg index 416a06ec..9292b564 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg index ea27a852..3bd307de 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg index 07ef75aa..27d4ce89 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg index 7a5d44da..453ee6e7 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg index 02157e07..ab6bd8ee 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg index d0e10056..30347642 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg index deaf8dec..9d74dd89 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg index a5a08508..018d18d8 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg index 5f3d2fca..f633a38f 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg index 14b714d2..08fbb156 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg index 111a54ee..c7b99a7d 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg index 8c28fb14..274f8a06 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg index f4cae89d..c6ae471d 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg index f514ca26..59b911ff 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density From fa4ade8a42f343290b51c358852e1d73cbd4d343 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 20 Nov 2025 17:00:27 +0100 Subject: [PATCH 11/29] Functionality for normal dist. and historical mean --- R/processCapabilityStudies.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index e9e669fb..9032d8d5 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -614,6 +614,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + tableDfCurrentStage <- data.frame(lsl = round(options[["lowerSpecificationLimitValue"]], .numDecimals), target = round(options[["targetValue"]], .numDecimals), usl = round(options[["upperSpecificationLimitValue"]], .numDecimals), @@ -1730,7 +1732,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - processMean <- mean(allData, na.rm = TRUE) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta From 166e735ce4a73518b1a22bb201ccdc96dd99b640 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 1 Dec 2025 19:04:02 +0100 Subject: [PATCH 12/29] All functionality added --- R/processCapabilityStudies.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 9032d8d5..836af8ef 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1732,7 +1732,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + processMean <- mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta From 52a2ed411b1cecccd974b7eea117e81a3cd90bab Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 7 Jan 2026 17:40:17 +0100 Subject: [PATCH 13/29] GUI: Extend dropdown menu with new dist. --- inst/qml/processCapabilityStudies.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index 7f01a050..e5bbca0c 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -324,9 +324,13 @@ Form values: [ {label: qsTr("Weibull"), value: "weibull"}, - {label: qsTr("Lognormal"), value: "lognormal"}, + {label: qsTr("Log-normal"), value: "lognormal"}, + {label: qsTr("Gamma"), value: "gamma"}, + {label: qsTr("Exponential"), value: "exponential"}, + {label: qsTr("Logistic"), value: "logistic"}, + {label: qsTr("Log-logistic"), value: "loglogistic"}, {label: qsTr("3-parameter Weibull"), value: "3ParameterWeibull"}, - {label: qsTr("3-parameter lognormal"), value: "3ParameterLognormal"} + {label: qsTr("3-parameter log-normal"), value: "3ParameterLognormal"} ] indexDefaultValue: 0 } From b55ac140e65747de134aa2dda390e157e5d8174f Mon Sep 17 00:00:00 2001 From: JTPetter Date: Tue, 20 Jan 2026 16:19:26 +0100 Subject: [PATCH 14/29] Extend dist. function --- R/commonQualityControl.R | 49 ++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index ecca85db..67690548 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1370,7 +1370,15 @@ KnownControlStats.RS <- function(N, sigma = 3) { return(list(p = p, CL = CL, UCL = UCL, LCL = LCL)) } -.distributionParameters <- function(data, distribution = c("lognormal", "weibull", "3ParameterLognormal", "3ParameterWeibull", "exponential")){ +.distributionParameters <- function(data, + distribution = c("lognormal", + "weibull", + "3ParameterLognormal", + "3ParameterWeibull", + "gamma", + "exponential", + "logistic", + "loglogistic")){ if (distribution == "lognormal") { fit_Lnorm <- try(EnvStats::elnorm(data)) if (jaspBase::isTryError(fit_Lnorm)) @@ -1403,13 +1411,40 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- temp$estimate[1] # shape theta <- temp$estimate[2] # scale threshold <- temp$estimate[3] # threshold + } else if (distribution == "gamma") { + gammaFit <- fitdistrplus::fitdist(data, "gamma", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2))) + beta <- gammaFit$estimate[1] # shape + theta <- gammaFit$estimate[2] # rate } else if (distribution == "exponential") { - fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", fix.arg = list("shape" = 1), - control = list(maxit = 500, abstol = .Machine$double.eps, reltol = .Machine$double.eps))) - if (jaspBase::isTryError(fit_Weibull)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- 1 - theta <- fit_Weibull$estimate[[1]] + expFit <- fitdistrplus::fitdist(data, "exp", method = "mle") + beta <- NA # not relevant for this distribution + theta <- 1/expFit$estimate[1] # scale + } else if (distribution == "logistic") { + logFit <- fitdistrplus::fitdist(data, "logis", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2))) + + beta <- logFit$estimate[1] # location + theta <- logFit$estimate[2] # scale + } else if (distribution == "loglogistic") { + dllogisTemp <- flexsurv::dllogis # because it is not possible to directly call flexsurv:: in the fitdist function + pllogisTemp <- flexsurv::pllogis + loglogFit <- fitdistrplus::fitdist(data, dllogisTemp, method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2)), start = list(shape = 1, scale = 1)) + beta <- log(loglogFit$estimate[2]) # Location + theta <- 1/loglogFit$estimate[1] # Scale } list <- list(beta = beta, theta = theta) From c0d9cfd9a8f76f63ca24334f36f16ca5a53b30e5 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 21 Jan 2026 15:50:24 +0100 Subject: [PATCH 15/29] Adjust function to always use fitdist --- R/commonQualityControl.R | 60 +++++++++++++++++---------- inst/qml/processCapabilityStudies.qml | 22 +++++++++- 2 files changed, 58 insertions(+), 24 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 67690548..08572115 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1380,11 +1380,11 @@ KnownControlStats.RS <- function(N, sigma = 3) { "logistic", "loglogistic")){ if (distribution == "lognormal") { - fit_Lnorm <- try(EnvStats::elnorm(data)) + fit_Lnorm <- try(fitdistrplus::fitdist(data, "lnorm", method = "mle")) if (jaspBase::isTryError(fit_Lnorm)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Lnorm$parameters[1] # shape / logmean - theta <- fit_Lnorm$parameters[2] # scale / log std. dev. + beta <- fit_Lnorm$estimate[1] # shape / logmean + theta <- fit_Lnorm$estimate[2] # scale / log std. dev. } else if (distribution == "weibull") { fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", control = list( @@ -1397,52 +1397,68 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- fit_Weibull$estimate[[1]] # shape theta <- fit_Weibull$estimate[[2]] # scale } else if(distribution == "3ParameterLognormal") { - temp <- try(EnvStats::elnorm3(data)) - if (jaspBase::isTryError(temp)) + dlnorm3Temp <- EnvStats::dlnorm3 + plnorm3Temp <- EnvStats::plnorm3 + lnorm3Fit <- try(fitdistrplus::fitdist(data, dlnorm3Temp, method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75), + start = list(meanlog = 0, sdlog = 1, threshold = 0))) + if (jaspBase::isTryError(lnorm3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$parameters[[1]] # shape / logmean - theta <- temp$parameters[[2]] # scale / log std. dev. - threshold <- temp$parameters[[3]] # threshold + beta <- lnorm3Fit$estimate[[1]] # shape / logmean + theta <- lnorm3Fit$estimate[[2]] # scale / log std. dev. + threshold <- lnorm3Fit$estimate[[3]] # threshold } else if(distribution == "3ParameterWeibull") { - temp <- try(MASS::fitdistr(data, function(x, shape, scale, thres) - dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))) - if (jaspBase::isTryError(temp)) + dweibull3Temp <- FAdist::dweibull3 + pweibull3Temp <- FAdist::pweibull3 + weilbull3Fit <- fitdistrplus::fitdist(data, dweibull3Temp, method = "mle", + start = list(shape = 0.1, scale = 1, thres = 0)) + if (jaspBase::isTryError(lnorm3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$estimate[1] # shape - theta <- temp$estimate[2] # scale - threshold <- temp$estimate[3] # threshold + beta <- weilbull3Fit$estimate[1] # shape + theta <- weilbull3Fit$estimate[2] # scale + threshold <- weilbull3Fit$estimate[3] # threshold } else if (distribution == "gamma") { - gammaFit <- fitdistrplus::fitdist(data, "gamma", method = "mle", + gammaFit <- try(fitdistrplus::fitdist(data, "gamma", method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2))) + ndeps = rep(1e-8, 2)))) + if (jaspBase::isTryError(gammaFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- gammaFit$estimate[1] # shape theta <- gammaFit$estimate[2] # rate } else if (distribution == "exponential") { - expFit <- fitdistrplus::fitdist(data, "exp", method = "mle") + expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle")) + if (jaspBase::isTryError(expFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- NA # not relevant for this distribution theta <- 1/expFit$estimate[1] # scale } else if (distribution == "logistic") { - logFit <- fitdistrplus::fitdist(data, "logis", method = "mle", + logFit <- try(fitdistrplus::fitdist(data, "logis", method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2))) - + ndeps = rep(1e-8, 2)))) + if (jaspBase::isTryError(logFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- logFit$estimate[1] # location theta <- logFit$estimate[2] # scale } else if (distribution == "loglogistic") { dllogisTemp <- flexsurv::dllogis # because it is not possible to directly call flexsurv:: in the fitdist function pllogisTemp <- flexsurv::pllogis - loglogFit <- fitdistrplus::fitdist(data, dllogisTemp, method = "mle", + loglogFit <- try(fitdistrplus::fitdist(data, dllogisTemp, method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), start = list(shape = 1, scale = 1)) + ndeps = rep(1e-8, 2)), start = list(shape = 1, scale = 1))) + if (jaspBase::isTryError(loglogFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- log(loglogFit$estimate[2]) # Location theta <- 1/loglogFit$estimate[1] # Scale } diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index e5bbca0c..1e557d81 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -341,7 +341,7 @@ Form label: qsTr("Historical shape") id: historicalShape childrenOnSameRow: true - visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" || nonNormalDistribution.currentValue == "gamma" DoubleField { @@ -353,13 +353,31 @@ Form } } + CheckBox + { + name: "historicalLocation" + label: qsTr("Historical location") + id: historicalLocation + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "logistic" || nonNormalDistribution.currentValue == "loglogistic" + + DoubleField + { + name: "historicalLocationValue" + id: historicalLocationValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + CheckBox { name: "historicalScale" label: qsTr("Historical scale") id: historicalScale childrenOnSameRow: true - visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" || nonNormalDistribution.currentValue == "gamma" || nonNormalDistribution.currentValue == "exponential" || nonNormalDistribution.currentValue == "logistic" || nonNormalDistribution.currentValue == "loglogistic" DoubleField { From 79dc4d9c92c1e5f9131108530df36dcfd4fd1e89 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 26 Jan 2026 19:00:45 +0100 Subject: [PATCH 16/29] Change all functions to fitdist, keeping results, add fix.arg --- R/commonQualityControl.R | 179 +++++++++++++++++++++++++++-------- R/doeAnalysis.R | 4 +- R/processCapabilityStudies.R | 4 +- 3 files changed, 142 insertions(+), 45 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 08572115..f452f19a 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1370,6 +1370,30 @@ KnownControlStats.RS <- function(N, sigma = 3) { return(list(p = p, CL = CL, UCL = UCL, LCL = LCL)) } +.allParametersFixed <- function(distribution, fix.arg) { + if (is.null(fix.arg)) + return(FALSE) + + distPars <- list( + "lognormal" = c("meanlog", "sdlog"), + "weibull" = c("shape", "scale"), + "3ParameterLognormal" = c("meanlog", "sdlog", "threshold"), + "3ParameterWeibull" = c("shape", "scale", "thres"), + "gamma" = c("shape", "scale"), + "exponential" = c("scale"), + "logistic" = c("location", "scale"), + "loglogistic" = c("shape", "scale") + ) + + pars <- distPars[[distribution]] + + if (is.null(pars)) + stop("Unknown distribution.", call. = FALSE) + + returnBol <- all(pars %in% names(fix.arg)) + return(returnBol) +} + .distributionParameters <- function(data, distribution = c("lognormal", "weibull", @@ -1378,72 +1402,140 @@ KnownControlStats.RS <- function(N, sigma = 3) { "gamma", "exponential", "logistic", - "loglogistic")){ + "loglogistic"), + fix.arg = NULL) { + + allParametersFixed <- .allParametersFixed(distribution, fix.arg) + if (distribution == "lognormal") { - fit_Lnorm <- try(fitdistrplus::fitdist(data, "lnorm", method = "mle")) - if (jaspBase::isTryError(fit_Lnorm)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Lnorm$estimate[1] # shape / logmean - theta <- fit_Lnorm$estimate[2] # scale / log std. dev. + if (allParametersFixed) { + beta <- fix.arg[["meanlog"]] # shape / logmean + theta <- fix.arg[["sdlog"]] # scale / log std. dev. + } else if (is.null(fix.arg)) { + # If no arguments are fixed, the "mvue" estimation method that is only implemented in EnvStats matches other software more closely + fitLnorm <- try(EnvStats::elnorm(data)) + if (jaspBase::isTryError(fitLnorm)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + beta <- fitLnorm$parameters[[1]] # shape / logmean + theta <- fitLnorm$parameters[[2]] # scale / log std. dev. + } else { + # If arguments are fixed, we have to use fitdistrplus + fitLnorm <- try(fitdistrplus::fitdist(data, "lnorm", method = "mle", fix.arg = fix.arg)) + + if (jaspBase::isTryError(fitLnorm)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + + lnormPars <- fitLnorm$estimate + if (!is.null(fix.arg)) { # we already know that, but to keep it consistent with the other chunks + lnormPars[names(fix.arg)] <- fix.arg + } + beta <- lnormPars[["meanlog"]] # shape / logmean + theta <- lnormPars[["sdlog"]] # scale / log std. dev. + } + } else if (distribution == "weibull") { - fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)))) - if (jaspBase::isTryError(fit_Weibull)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Weibull$estimate[[1]] # shape - theta <- fit_Weibull$estimate[[2]] # scale + if (allParametersFixed) { + beta <- fix.arg[["shape"]] # shape + theta <- fix.arg[["scale"]] # scale + } else { + fitWeibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75), + fix.arg = fix.arg)) + + if (jaspBase::isTryError(fitWeibull)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + + weibullPars <- fitWeibull$estimate + if (!is.null(fix.arg)) { # we already know that, but to keep it consistent with the other chunks + weibullPars[names(fix.arg)] <- fix.arg + } + beta <- weibullPars[["shape"]] # shape / logmean + theta <- weibullPars[["scale"]] # scale / log std. dev. + } } else if(distribution == "3ParameterLognormal") { - dlnorm3Temp <- EnvStats::dlnorm3 - plnorm3Temp <- EnvStats::plnorm3 + dlnorm3Temp <- function(x, meanlog, sdlog, threshold) { + EnvStats::dlnorm3(x, meanlog = meanlog, sdlog = sdlog, threshold = threshold) + } + plnorm3Temp <- function(q, meanlog, sdlog, threshold) { + EnvStats::plnorm3(q, meanlog = meanlog, sdlog = sdlog, threshold = threshold) + } + # Set starting values that match other software packages more closely + lnorm3start <- EnvStats::elnorm3(data)$parameters + lnorm3startMeanLog <- lnorm3start[[1]] + lnorm3startSdLog <- lnorm3start[[2]] + lnorm3startThreshold <- lnorm3start[[3]] + + # Estimate parameters using fitdistrplus, because it can keep values fixed lnorm3Fit <- try(fitdistrplus::fitdist(data, dlnorm3Temp, method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, reltol = .Machine$double.eps^0.75), - start = list(meanlog = 0, sdlog = 1, threshold = 0))) + start = list(meanlog = lnorm3startMeanLog, + sdlog = lnorm3startSdLog, + threshold = lnorm3startThreshold), + fix.arg = fix.arg)) if (jaspBase::isTryError(lnorm3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- lnorm3Fit$estimate[[1]] # shape / logmean theta <- lnorm3Fit$estimate[[2]] # scale / log std. dev. threshold <- lnorm3Fit$estimate[[3]] # threshold } else if(distribution == "3ParameterWeibull") { - dweibull3Temp <- FAdist::dweibull3 - pweibull3Temp <- FAdist::pweibull3 - weilbull3Fit <- fitdistrplus::fitdist(data, dweibull3Temp, method = "mle", - start = list(shape = 0.1, scale = 1, thres = 0)) - if (jaspBase::isTryError(lnorm3Fit)) + dweibull3Temp <- function(x, shape, scale, thres) { + FAdist::dweibull3(x, shape = shape, scale = scale, thres = thres) + } + pweibull3Temp <- function(q, shape, scale, thres) { + FAdist::pweibull3(q, shape = shape, scale = scale, thres = thres) + } + + # Set starting values that match other software packages more closely + weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) + dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))$estimate + weibull3startShape <- weibull3start[[1]] + weibull3startScale <- weibull3start[[2]] + weibull3startThres <- weibull3start[[3]] + + # Estimate parameters using fitdistrplus, because it can keep values fixed + weilbull3Fit <- try(fitdistrplus::fitdist(data, dweibull3Temp, method = "mle", + start = list(shape = weibull3startShape, + scale = weibull3startScale, + thres = weibull3startThres), + fix.arg = fix.arg)) + if (jaspBase::isTryError(weilbull3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- weilbull3Fit$estimate[1] # shape theta <- weilbull3Fit$estimate[2] # scale threshold <- weilbull3Fit$estimate[3] # threshold } else if (distribution == "gamma") { gammaFit <- try(fitdistrplus::fitdist(data, "gamma", method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)))) + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2)), + fix.arg = fix.arg)) if (jaspBase::isTryError(gammaFit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- gammaFit$estimate[1] # shape theta <- gammaFit$estimate[2] # rate } else if (distribution == "exponential") { - expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle")) + expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle", + fix.arg = fix.arg)) if (jaspBase::isTryError(expFit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- NA # not relevant for this distribution theta <- 1/expFit$estimate[1] # scale } else if (distribution == "logistic") { logFit <- try(fitdistrplus::fitdist(data, "logis", method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)))) + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2)), + fix.arg = fix.arg)) if (jaspBase::isTryError(logFit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- logFit$estimate[1] # location @@ -1452,11 +1544,14 @@ KnownControlStats.RS <- function(N, sigma = 3) { dllogisTemp <- flexsurv::dllogis # because it is not possible to directly call flexsurv:: in the fitdist function pllogisTemp <- flexsurv::pllogis loglogFit <- try(fitdistrplus::fitdist(data, dllogisTemp, method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), start = list(shape = 1, scale = 1))) + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2)), + start = list(shape = 1, + scale = 1), + fix.arg = fix.arg)) if (jaspBase::isTryError(loglogFit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- log(loglogFit$estimate[2]) # Location @@ -1464,8 +1559,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { } list <- list(beta = beta, theta = theta) - if(distribution == '3ParameterWeibull' | distribution == "3ParameterLognormal") - list['threshold'] <- threshold + if(distribution == "3ParameterWeibull" | distribution == "3ParameterLognormal") + list["threshold"] <- threshold return(list) } diff --git a/R/doeAnalysis.R b/R/doeAnalysis.R index bf0d06f1..eb75ad9e 100644 --- a/R/doeAnalysis.R +++ b/R/doeAnalysis.R @@ -1693,7 +1693,9 @@ get_levels <- function(var, num_levels, dataset) { return() } result <- jaspResults[[dep]][["doeResult"]]$object[["regression"]] - plot$plotObject <- jaspGraphs::plotQQnorm(resid(result[["object"]]), abline = TRUE) + ggplot2::scale_x_continuous(expand = ggplot2::expansion(mult = 0.1)) + ggplot2::scale_y_continuous(expand = ggplot2::expansion(mult = 0.1)) + plot$plotObject <- jaspGraphs::plotQQnorm(resid(result[["object"]]), abline = TRUE) + + ggplot2::scale_x_continuous(expand = ggplot2::expansion(mult = 0.1), name = gettext("Theoretical quantiles")) + + ggplot2::scale_y_continuous(expand = ggplot2::expansion(mult = 0.1), name = gettext("Observed quantiles")) } } diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 836af8ef..380454af 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -516,12 +516,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { ) # return state if available - if(!is.null(jaspResults[["dataTransformationState"]])) return(jaspResults[["dataTransformationState"]]$object) + if (!is.null(jaspResults[["dataTransformationState"]])) return(jaspResults[["dataTransformationState"]]$object) # transform data and return parameters of the transform result <- try(.qcTransformData(dataset = dataset, measurements = measurements, options = options)) - if(isTryError(result)) { + if (isTryError(result)) { message <- gettextf("Data could not be transformed: %1$s", .extractErrorMessage(result)) .quitAnalysis(message) } From ba870063ee8a9d7233f8f1fc76b02154a0e446be Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 28 Jan 2026 16:25:41 +0100 Subject: [PATCH 17/29] fitdist environment things --- R/commonQualityControl.R | 172 ++++++++++++++++++++++++++------------- renv.lock | 2 +- 2 files changed, 118 insertions(+), 56 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index f452f19a..30ae8898 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1406,7 +1406,9 @@ KnownControlStats.RS <- function(N, sigma = 3) { fix.arg = NULL) { allParametersFixed <- .allParametersFixed(distribution, fix.arg) - + #################### + #### Lognormal ##### + ##################### if (distribution == "lognormal") { if (allParametersFixed) { beta <- fix.arg[["meanlog"]] # shape / logmean @@ -1432,7 +1434,9 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- lnormPars[["meanlog"]] # shape / logmean theta <- lnormPars[["sdlog"]] # scale / log std. dev. } - + #################### + #### Weibull ##### + ##################### } else if (distribution == "weibull") { if (allParametersFixed) { beta <- fix.arg[["shape"]] # shape @@ -1449,66 +1453,112 @@ KnownControlStats.RS <- function(N, sigma = 3) { stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) weibullPars <- fitWeibull$estimate - if (!is.null(fix.arg)) { # we already know that, but to keep it consistent with the other chunks + if (!is.null(fix.arg)) { weibullPars[names(fix.arg)] <- fix.arg } beta <- weibullPars[["shape"]] # shape / logmean theta <- weibullPars[["scale"]] # scale / log std. dev. } + + ################################ + #### 3-parameter lognormal ##### + ################################ } else if(distribution == "3ParameterLognormal") { - dlnorm3Temp <- function(x, meanlog, sdlog, threshold) { - EnvStats::dlnorm3(x, meanlog = meanlog, sdlog = sdlog, threshold = threshold) - } - plnorm3Temp <- function(q, meanlog, sdlog, threshold) { - EnvStats::plnorm3(q, meanlog = meanlog, sdlog = sdlog, threshold = threshold) - } - # Set starting values that match other software packages more closely - lnorm3start <- EnvStats::elnorm3(data)$parameters - lnorm3startMeanLog <- lnorm3start[[1]] - lnorm3startSdLog <- lnorm3start[[2]] - lnorm3startThreshold <- lnorm3start[[3]] - - # Estimate parameters using fitdistrplus, because it can keep values fixed - lnorm3Fit <- try(fitdistrplus::fitdist(data, dlnorm3Temp, method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75), - start = list(meanlog = lnorm3startMeanLog, - sdlog = lnorm3startSdLog, - threshold = lnorm3startThreshold), - fix.arg = fix.arg)) - if (jaspBase::isTryError(lnorm3Fit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- lnorm3Fit$estimate[[1]] # shape / logmean - theta <- lnorm3Fit$estimate[[2]] # scale / log std. dev. - threshold <- lnorm3Fit$estimate[[3]] # threshold - } else if(distribution == "3ParameterWeibull") { - dweibull3Temp <- function(x, shape, scale, thres) { - FAdist::dweibull3(x, shape = shape, scale = scale, thres = thres) - } - pweibull3Temp <- function(q, shape, scale, thres) { - FAdist::pweibull3(q, shape = shape, scale = scale, thres = thres) + if (allParametersFixed) { + beta <- fix.arg[["meanlog"]] # shape + theta <- fix.arg[["sdlog"]] # scale + threshold <- fix.arg[["threshold"]] # threshold + } else { + # Set starting values that match other software packages more closely + lnorm3start <- EnvStats::elnorm3(data)$parameters + lnorm3startMeanLog <- lnorm3start[[1]] + lnorm3startSdLog <- lnorm3start[[2]] + lnorm3startThreshold <- lnorm3start[[3]] + lnorm3startList <- list(meanlog = lnorm3startMeanLog, + sdlog = lnorm3startSdLog, + threshold = lnorm3startThreshold) + + dlnorm3Temp <- function(x, meanlog = 0, sdlog = 1, threshold = 0) { + EnvStats::dlnorm3(x, meanlog = meanlog, sdlog = sdlog, threshold = threshold) + } + .GlobalEnv[["dlnorm3Temp"]] <- dlnorm3Temp + plnorm3Temp <- function(q, meanlog = 0, sdlog = 1, threshold = 0) { + EnvStats::plnorm3(q, meanlog = meanlog, sdlog = sdlog, threshold = threshold) + } + .GlobalEnv[["plnorm3Temp"]] <- plnorm3Temp + + # remove any parameters that are fixed + if (!is.null(fix.arg)) { + lnorm3startList <- lnorm3startList[!names(lnorm3startList) %in% names(fix.arg)] + } + + # Estimate parameters using fitdistrplus, because it can keep values fixed + lnorm3Fit <- try(fitdistrplus::fitdist(data, "lnorm3Temp", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75), + start = lnorm3startList, + fix.arg = fix.arg)) + if (jaspBase::isTryError(lnorm3Fit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + + + lnorm3Pars <- lnorm3Fit$estimate + if (!is.null(fix.arg)) { + lnorm3Pars[names(fix.arg)] <- fix.arg + } + beta <- lnorm3Pars[["meanlog"]] # shape / logmean + theta <- lnorm3Pars[["sdlog"]] # scale / log std. dev. + threshold <- lnorm3Pars[["threshold"]] # threshold + + beta <- lnorm3Fit$estimate[[1]] # shape / logmean + theta <- lnorm3Fit$estimate[[2]] # scale / log std. dev. + threshold <- lnorm3Fit$estimate[[3]] # threshold } + ################################ + #### 3-parameter weibull ##### + ################################ + } else if (distribution == "3ParameterWeibull") { + if (allParametersFixed) { + beta <- fix.arg[["shape"]] # shape + theta <- fix.arg[["scale"]] # scale + threshold <- fix.arg[["threshold"]] # threshold + } else { - # Set starting values that match other software packages more closely - weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) - dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))$estimate - weibull3startShape <- weibull3start[[1]] - weibull3startScale <- weibull3start[[2]] - weibull3startThres <- weibull3start[[3]] - - # Estimate parameters using fitdistrplus, because it can keep values fixed - weilbull3Fit <- try(fitdistrplus::fitdist(data, dweibull3Temp, method = "mle", - start = list(shape = weibull3startShape, - scale = weibull3startScale, - thres = weibull3startThres), - fix.arg = fix.arg)) - if (jaspBase::isTryError(weilbull3Fit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- weilbull3Fit$estimate[1] # shape - theta <- weilbull3Fit$estimate[2] # scale - threshold <- weilbull3Fit$estimate[3] # threshold + # Wrap distribution functions and make available in environment + dweibull3Temp <- function(x, shape, scale, thres) { + FAdist::dweibull3(x, shape = shape, scale = scale, thres = thres) + } + .GlobalEnv[["dweibull3Temp"]] <- dweibull3Temp + + pweibull3Temp <- function(q, shape, scale, thres) { + FAdist::pweibull3(q, shape = shape, scale = scale, thres = thres) + } + .GlobalEnv[["pweibull3Temp"]] <- pweibull3Temp + + # Set starting values that match other software packages more closely + weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) + dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))$estimate + weibull3startShape <- weibull3start[[1]] + weibull3startScale <- weibull3start[[2]] + weibull3startThres <- weibull3start[[3]] + + # Estimate parameters using fitdistrplus, because it can keep values fixed + weilbull3Fit <- try(fitdistrplus::fitdist(data, "weibull3Temp", method = "mle", + start = list(shape = weibull3startShape, + scale = weibull3startScale, + thres = weibull3startThres), + fix.arg = fix.arg)) + if (jaspBase::isTryError(weilbull3Fit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + beta <- weilbull3Fit$estimate[1] # shape + theta <- weilbull3Fit$estimate[2] # scale + threshold <- weilbull3Fit$estimate[3] # threshold + } + ################# + #### Gamma ##### + ################# } else if (distribution == "gamma") { gammaFit <- try(fitdistrplus::fitdist(data, "gamma", method = "mle", control = list( @@ -1521,6 +1571,10 @@ KnownControlStats.RS <- function(N, sigma = 3) { stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- gammaFit$estimate[1] # shape theta <- gammaFit$estimate[2] # rate + + ####################### + #### Exponential ##### + ####################### } else if (distribution == "exponential") { expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle", fix.arg = fix.arg)) @@ -1528,6 +1582,10 @@ KnownControlStats.RS <- function(N, sigma = 3) { stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- NA # not relevant for this distribution theta <- 1/expFit$estimate[1] # scale + + ####################### + #### Logistic ##### + ####################### } else if (distribution == "logistic") { logFit <- try(fitdistrplus::fitdist(data, "logis", method = "mle", control = list( @@ -1540,6 +1598,10 @@ KnownControlStats.RS <- function(N, sigma = 3) { stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) beta <- logFit$estimate[1] # location theta <- logFit$estimate[2] # scale + + ####################### + #### Loglogistic ##### + ####################### } else if (distribution == "loglogistic") { dllogisTemp <- flexsurv::dllogis # because it is not possible to directly call flexsurv:: in the fitdist function pllogisTemp <- flexsurv::pllogis @@ -1559,7 +1621,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { } list <- list(beta = beta, theta = theta) - if(distribution == "3ParameterWeibull" | distribution == "3ParameterLognormal") + if (distribution == "3ParameterWeibull" | distribution == "3ParameterLognormal") list["threshold"] <- threshold return(list) } diff --git a/renv.lock b/renv.lock index 51556684..81b9db31 100644 --- a/renv.lock +++ b/renv.lock @@ -738,7 +738,7 @@ }, "fitdistrplus": { "Package": "fitdistrplus", - "Version": "1.2-4", + "Version": "1.2-6", "Source": "Repository", "Requirements": [ "grDevices", From 30f45e411d1a9d15247201319c5b6703bc291fa3 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 28 Jan 2026 17:09:35 +0100 Subject: [PATCH 18/29] Add all new dist. to dist. fit function --- R/commonQualityControl.R | 170 +++++++++++++++++++++++++-------------- 1 file changed, 111 insertions(+), 59 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 30ae8898..984caa9c 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1379,8 +1379,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { "weibull" = c("shape", "scale"), "3ParameterLognormal" = c("meanlog", "sdlog", "threshold"), "3ParameterWeibull" = c("shape", "scale", "thres"), - "gamma" = c("shape", "scale"), - "exponential" = c("scale"), + "gamma" = c("shape", "rate"), + "exponential" = c("rate"), "logistic" = c("location", "scale"), "loglogistic" = c("shape", "scale") ) @@ -1511,10 +1511,6 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- lnorm3Pars[["meanlog"]] # shape / logmean theta <- lnorm3Pars[["sdlog"]] # scale / log std. dev. threshold <- lnorm3Pars[["threshold"]] # threshold - - beta <- lnorm3Fit$estimate[[1]] # shape / logmean - theta <- lnorm3Fit$estimate[[2]] # scale / log std. dev. - threshold <- lnorm3Fit$estimate[[3]] # threshold } ################################ #### 3-parameter weibull ##### @@ -1525,6 +1521,12 @@ KnownControlStats.RS <- function(N, sigma = 3) { theta <- fix.arg[["scale"]] # scale threshold <- fix.arg[["threshold"]] # threshold } else { + # Set starting values that match other software packages more closely + weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) + dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))$estimate + weibull3startShape <- weibull3start[[1]] + weibull3startScale <- weibull3start[[2]] + weibull3startThres <- weibull3start[[3]] # Wrap distribution functions and make available in environment dweibull3Temp <- function(x, shape, scale, thres) { @@ -1537,13 +1539,6 @@ KnownControlStats.RS <- function(N, sigma = 3) { } .GlobalEnv[["pweibull3Temp"]] <- pweibull3Temp - # Set starting values that match other software packages more closely - weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) - dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))$estimate - weibull3startShape <- weibull3start[[1]] - weibull3startScale <- weibull3start[[2]] - weibull3startThres <- weibull3start[[3]] - # Estimate parameters using fitdistrplus, because it can keep values fixed weilbull3Fit <- try(fitdistrplus::fitdist(data, "weibull3Temp", method = "mle", start = list(shape = weibull3startShape, @@ -1552,72 +1547,129 @@ KnownControlStats.RS <- function(N, sigma = 3) { fix.arg = fix.arg)) if (jaspBase::isTryError(weilbull3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- weilbull3Fit$estimate[1] # shape - theta <- weilbull3Fit$estimate[2] # scale - threshold <- weilbull3Fit$estimate[3] # threshold + + weibull3Pars <- weilbull3Fit$estimate + + if (!is.null(fix.arg)) { + weibull3Pars[names(fix.arg)] <- fix.arg + } + + beta <- weibull3Pars[["shape"]] # shape / logmean + theta <- weibull3Pars[["scale"]] # scale / log std. dev. + threshold <- weibull3Pars[["thres"]] # threshold } ################# #### Gamma ##### ################# } else if (distribution == "gamma") { - gammaFit <- try(fitdistrplus::fitdist(data, "gamma", method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), - fix.arg = fix.arg)) - if (jaspBase::isTryError(gammaFit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- gammaFit$estimate[1] # shape - theta <- gammaFit$estimate[2] # rate + if (allParametersFixed) { + beta <- fix.arg[["shape"]] # shape + theta <- 1/fix.arg[["rate"]] # scale + } else { + gammaFit <- try(fitdistrplus::fitdist(data$Diameter, "gamma", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75), + fix.arg = fix.arg)) + if (jaspBase::isTryError(gammaFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + gammaPars <- gammaFit$estimate + + if (!is.null(fix.arg)) { + gammaPars[names(fix.arg)] <- fix.arg + } + + beta <- gammaPars[["shape"]] # shape + theta <- 1/gammaPars[["rate"]] # scale + } ####################### #### Exponential ##### ####################### } else if (distribution == "exponential") { - expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle", - fix.arg = fix.arg)) - if (jaspBase::isTryError(expFit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- NA # not relevant for this distribution - theta <- 1/expFit$estimate[1] # scale + if (allParametersFixed) { + beta <- NA # not relevant for this distribution + theta <- 1/fix.arg[["rate"]] # scale + } else { + expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle")) # since there is only one parameter, there is no parameter to keep fixed + + if (jaspBase::isTryError(expFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + # Since there is only one parameter, we also don't need to check if any parameter is fixed + beta <- NA # not relevant for this distribution + theta <- 1/expFit$estimate[1] # scale + } ####################### #### Logistic ##### ####################### } else if (distribution == "logistic") { - logFit <- try(fitdistrplus::fitdist(data, "logis", method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), - fix.arg = fix.arg)) - if (jaspBase::isTryError(logFit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- logFit$estimate[1] # location - theta <- logFit$estimate[2] # scale + if (allParametersFixed) { + beta <- fix.arg[["location"]] # location + theta <- fix.arg[["scale"]] # scale + } else { + + logFit <- try(fitdistrplus::fitdist(data, "logis", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75), + fix.arg = fix.arg)) + if (jaspBase::isTryError(logFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + + logPars <- logFit$estimate + + if (!is.null(fix.arg)) { + logPars[names(fix.arg)] <- fix.arg + } + + beta <- logPars[["location"]] # location + theta <- logPars[["scale"]] # scale + } ####################### #### Loglogistic ##### ####################### } else if (distribution == "loglogistic") { - dllogisTemp <- flexsurv::dllogis # because it is not possible to directly call flexsurv:: in the fitdist function - pllogisTemp <- flexsurv::pllogis - loglogFit <- try(fitdistrplus::fitdist(data, dllogisTemp, method = "mle", - control = list( - maxit = 10000, - abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), - start = list(shape = 1, - scale = 1), - fix.arg = fix.arg)) - if (jaspBase::isTryError(loglogFit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- log(loglogFit$estimate[2]) # Location - theta <- 1/loglogFit$estimate[1] # Scale + if (allParametersFixed) { + beta <- log(fix.arg[["scale"]]) # log(scale) -> loglocation + theta <- fix.arg[["shape"]] # 1/shape -> Scale + } else { + + # Wrap distribution functions and make available in environment + dllogisTemp <- function(x, shape, scale) { + flexsurv::dllogis(x, shape = shape, scale = scale) + } + .GlobalEnv[["dllogisTemp"]] <- dllogisTemp + + pllogisTemp <- function(q, shape, scale) { + flexsurv::pllogis(q, shape = shape, scale = scale) + } + .GlobalEnv[["pllogisTemp"]] <- pllogisTemp + + loglogFit <- try(fitdistrplus::fitdist(data$Diameter, "llogisTemp", method = "mle", + control = list( + maxit = 10000, + abstol = .Machine$double.eps^0.75, + reltol = .Machine$double.eps^0.75, + ndeps = rep(1e-8, 2)), + start = list(shape = 1, + scale = 1), + fix.arg = fix.arg)) + if (jaspBase::isTryError(loglogFit)) + stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) + + loglogPars <- loglogFit$estimate + + if (!is.null(fix.arg)) { + loglogPars[names(fix.arg)] <- fix.arg + } + + beta <- log(logPars[["scale"]]) # log(scale) -> loglocation + theta <- 1/logPars[["scale"]] # 1/shape -> Scale + } } list <- list(beta = beta, theta = theta) From b0782f23d68ed717fd0cfad9371be88a40e21147 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 30 Jan 2026 16:05:05 +0100 Subject: [PATCH 19/29] Implement new distributions for plot overlay dist. --- R/commonQualityControl.R | 37 ++++-- R/processCapabilityStudies.R | 244 +++++++++++++++++++++++------------ 2 files changed, 189 insertions(+), 92 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 984caa9c..06421266 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1519,7 +1519,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { if (allParametersFixed) { beta <- fix.arg[["shape"]] # shape theta <- fix.arg[["scale"]] # scale - threshold <- fix.arg[["threshold"]] # threshold + threshold <- fix.arg[["thres"]] # threshold } else { # Set starting values that match other software packages more closely weibull3start <- MASS::fitdistr(data, function(x, shape, scale, thres) @@ -1527,6 +1527,9 @@ KnownControlStats.RS <- function(N, sigma = 3) { weibull3startShape <- weibull3start[[1]] weibull3startScale <- weibull3start[[2]] weibull3startThres <- weibull3start[[3]] + weibull3startList <- list(shape = weibull3startShape, + scale = weibull3startScale, + thres = weibull3startThres) # Wrap distribution functions and make available in environment dweibull3Temp <- function(x, shape, scale, thres) { @@ -1539,11 +1542,14 @@ KnownControlStats.RS <- function(N, sigma = 3) { } .GlobalEnv[["pweibull3Temp"]] <- pweibull3Temp + # remove any parameters that are fixed + if (!is.null(fix.arg)) { + weibull3startList <- weibull3startList[!names(weibull3startList) %in% names(fix.arg)] + } + # Estimate parameters using fitdistrplus, because it can keep values fixed weilbull3Fit <- try(fitdistrplus::fitdist(data, "weibull3Temp", method = "mle", - start = list(shape = weibull3startShape, - scale = weibull3startScale, - thres = weibull3startThres), + start = weibull3startList, fix.arg = fix.arg)) if (jaspBase::isTryError(weilbull3Fit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) @@ -1554,8 +1560,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { weibull3Pars[names(fix.arg)] <- fix.arg } - beta <- weibull3Pars[["shape"]] # shape / logmean - theta <- weibull3Pars[["scale"]] # scale / log std. dev. + beta <- weibull3Pars[["shape"]] # shape + theta <- weibull3Pars[["scale"]] # scale threshold <- weibull3Pars[["thres"]] # threshold } ################# @@ -1566,7 +1572,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- fix.arg[["shape"]] # shape theta <- 1/fix.arg[["rate"]] # scale } else { - gammaFit <- try(fitdistrplus::fitdist(data$Diameter, "gamma", method = "mle", + gammaFit <- try(fitdistrplus::fitdist(data, "gamma", method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, @@ -1635,7 +1641,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { } else if (distribution == "loglogistic") { if (allParametersFixed) { beta <- log(fix.arg[["scale"]]) # log(scale) -> loglocation - theta <- fix.arg[["shape"]] # 1/shape -> Scale + theta <- 1/fix.arg[["shape"]] # 1/shape -> Scale } else { # Wrap distribution functions and make available in environment @@ -1649,14 +1655,21 @@ KnownControlStats.RS <- function(N, sigma = 3) { } .GlobalEnv[["pllogisTemp"]] <- pllogisTemp - loglogFit <- try(fitdistrplus::fitdist(data$Diameter, "llogisTemp", method = "mle", + loglogStartList <- list(shape = 1, + scale = 1) + + # remove any parameters that are fixed + if (!is.null(fix.arg)) { + loglogStartList <- loglogStartList[!names(loglogStartList) %in% names(fix.arg)] + } + + loglogFit <- try(fitdistrplus::fitdist(data, "llogisTemp", method = "mle", control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, reltol = .Machine$double.eps^0.75, ndeps = rep(1e-8, 2)), - start = list(shape = 1, - scale = 1), + start = loglogStartList, fix.arg = fix.arg)) if (jaspBase::isTryError(loglogFit)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) @@ -1668,7 +1681,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { } beta <- log(logPars[["scale"]]) # log(scale) -> loglocation - theta <- 1/logPars[["scale"]] # 1/shape -> Scale + theta <- 1/logPars[["shape"]] # 1/shape -> Scale } } list <- list(beta = beta, diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 380454af..31359e61 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -738,6 +738,82 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { plot$plotObject <- jaspGraphs::ggMatrixPlot(plotMat) } + +.buildFixArg <- function(distribution, options) { + + fix.arg <- list() + + + # SHAPE + if (distribution %in% c("weibull", "3ParameterWeibull", "gamma")) { + if (options[["historicalShape"]]) { + fix.arg[["shape"]] <- options[["historicalShapeValue"]] + } + } + + # LOGLOGISTIC SPECIAL CASE + if (distribution == "loglogistic") { + + # GUI scale → shape + if (options[["historicalScale"]]) { + fix.arg[["shape"]] <- options[["historicalScaleValue"]] # to match the parameters of other software + } + + # GUI location → scale + if (options[["historicalLocation"]]) { + fix.arg[["scale"]] <- options[["historicalLocationValue"]] # to match the parameters of other software + } + } + + # SCALE / RATE (standard cases) + if (distribution %in% c("weibull", "3ParameterWeibull", "logistic")) { + if (options[["historicalScale"]]) { + fix.arg[["scale"]] <- options[["historicalScaleValue"]] + } + } + + if (distribution %in% c("gamma", "exponential")) { + if (options[["historicalScale"]]) { + fix.arg[["rate"]] <- 1 / options[["historicalScaleValue"]] # transformed scale to rate + } + } + + # LOCATION + if (distribution == "logistic") { + if (options[["historicalLocation"]]) { + fix.arg[["location"]] <- options[["historicalLocationValue"]] + } + } + + # LOGNORMAL PARAMETERS + if (distribution %in% c("lognormal", "3ParameterLognormal")) { + + if (options[["historicalLogMean"]]) { + fix.arg[["meanlog"]] <- options[["historicalLogMeanValue"]] + } + + if (options[["historicalLogStdDev"]]) { + fix.arg[["sdlog"]] <- options[["historicalLogStdDevValue"]] + } + } + + # THRESHOLD + if (distribution == "3ParameterLognormal") { + if (options[["historicalThreshold"]]) { + fix.arg[["threshold"]] <- options[["historicalThresholdValue"]] + } + } + + if (distribution == "3ParameterWeibull") { + if (options[["historicalThreshold"]]) { + fix.arg[["thres"]] <- options[["historicalThresholdValue"]] + } + } + + fix.arg <- if (length(fix.arg) == 0) NULL else fix.arg + return(fix.arg) +} + .qcProcessCapabilityPlotObject <- function(options, dataset, measurements, stages, distribution = c('normal', "weibull", "lognormal", "3ParameterLognormal", "3ParameterWeibull")) { if (identical(stages, "")) { nStages <- 1 @@ -803,45 +879,30 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c() legendLabels <- c() - # logic that checks if all parameters necessary for the non-normal distributions are given as historical, if yes, skip the dist. est. function, else replace only the given parameters - if (distribution != "normal") - allParametersHistorical <- switch( - options[["nonNormalDistribution"]], - "weibull" = options[["historicalShape"]] && options[["historicalScale"]], - "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], - "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], - "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], - FALSE # default - ) + # for non normal dist, create fix.arg list based on historical values + if (distribution != "normal") + fix.arg <- .buildFixArg(distribution, options) # Overlay distribution if (options[["processCapabilityPlotDistributions"]]) { if (distribution == "normal") { processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) if (.qcWithinProcessValid(options)) { - p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sd(allData)), - mapping = ggplot2::aes(color = "sdoDist", linetype = "sdoDist")) + - ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sdw), - mapping = ggplot2::aes(color = "sdwDist", linetype = "sdwDist")) - legendColors <- c(legendColors, "dodgerblue", "red") - legendLty <- c(legendLty, "solid", "solid") - legendLabels <- c(legendLabels, gettext("Normal dist.\n(std. dev. total)"), - gettext("Normal dist.\n(std. dev. within)")) + p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sd(allData)), + mapping = ggplot2::aes(color = "sdoDist", linetype = "sdoDist")) + + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sdw), + mapping = ggplot2::aes(color = "sdwDist", linetype = "sdwDist")) + legendColors <- c(legendColors, "dodgerblue", "red") + legendLty <- c(legendLty, "solid", "solid") + legendLabels <- c(legendLabels, gettext("Normal dist.\n(std. dev. total)"), + gettext("Normal dist.\n(std. dev. within)")) } } else if (distribution == "weibull") { - if (allParametersHistorical) { - # If all are historical, assign parameters as given in options - distParameters <- list(beta = options[["historicalShapeValue"]], - theta = options[["historicalScaleValue"]]) - } else { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) - if (options[["historicalShape"]]) - distParameters$beta <- options[["historicalShapeValue"]] - if (options[["historicalScale"]]) - distParameters$beta <- options[["historicalScaleValue"]] - } + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) shape <- distParameters$beta scale <- distParameters$theta p <- p + ggplot2::stat_function(fun = dweibull, args = list(shape = shape, scale = scale), @@ -850,68 +911,38 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("Weibull dist.")) } else if (distribution == "lognormal") { - if (allParametersHistorical) { - # If all are historical, assign parameters as given in options - distParameters <- list(beta = options[["historicalLogMeanValue"]], - theta = options[["historicalLogStdDevValue"]]) - } else { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) - if (options[["historicalLogMean"]]) - distParameters$beta <- options[["historicalLogMeanValue"]] - if (options[["historicalLogStdDev"]]) - distParameters$theta <- options[["historicalLogStdDevValue"]] - } - shape <- distParameters$beta - scale <- distParameters$theta - p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = shape, sdlog = scale), + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + meanlog <- distParameters$beta + sdlog <- distParameters$theta + p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = meanlog, sdlog = sdlog), mapping = ggplot2::aes(color = "lognormal", linetype = "lognormal")) legendColors <- c(legendColors, "red") legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, "Lognormal dist.") } else if (distribution == "3ParameterLognormal") { - if (allParametersHistorical) { - # If all are historical, assign parameters as given in options - distParameters <- list(beta = options[["historicalLogMeanValue"]], - theta = options[["historicalLogStdDevValue"]], - threshold = options[["historicalThresholdValue"]]) - } else { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) - if (options[["historicalLogMean"]]) - distParameters$beta <- options[["historicalLogMeanValue"]] - if (options[["historicalLogStdDev"]]) - distParameters$theta <- options[["historicalLogStdDevValue"]] - if (options[["historicalThreshold"]]) - distParameters$threshold <- options[["historicalThresholdValue"]] - } - shape <- distParameters$theta # The distribution function uses theta for shape and beta for scale, which is reverse to convention - scale <- distParameters$beta + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + meanlog <- distParameters$beta + sdlog <- distParameters$theta threshold <- distParameters$threshold - p <- p + ggplot2::stat_function(fun = FAdist::dlnorm3 , args = list(shape = shape, scale = scale, thres = threshold), + p <- p + ggplot2::stat_function(fun = EnvStats::dlnorm3, args = list(meanlog = meanlog, sdlog = sdlog, threshold = threshold), mapping = ggplot2::aes(color = "lognormal3", linetype = "lognormal3")) legendColors <- c(legendColors, "red") legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("3-parameter\nlognormal dist.")) } else if (distribution == "3ParameterWeibull") { - if (allParametersHistorical) { - # If all are historical, assign parameters as given in options - distParameters <- list(beta = options[["historicalShapeValue"]], - theta = options[["historicalScaleValue"]], - threshold = options[["historicalThresholdValue"]]) - } else { - distParameters <- .distributionParameters(data = allData, distribution = distribution) + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) if (jaspBase::isTryError(distParameters)) stop(distParameters[1], call. = FALSE) - if (options[["historicalShape"]]) - distParameters$beta <- options[["historicalShapeValue"]] - if (options[["historicalScale"]]) - distParameters$beta <- options[["historicalScaleValue"]] - if (options[["historicalThreshold"]]) - distParameters$threshold <- options[["historicalThresholdValue"]] - } shape <- distParameters$beta scale <- distParameters$theta threshold <- distParameters$threshold @@ -920,6 +951,59 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendColors <- c(legendColors, "red") legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("3-parameter Weibull dist.")) + } else if (distribution == "gamma") { + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + shape <- distParameters$beta + scale <- distParameters$theta + p <- p + ggplot2::stat_function(fun = dgamma , args = list(shape = shape, scale = scale), + mapping = ggplot2::aes(color = "gamma", linetype = "gamma")) + legendColors <- c(legendColors, "red") + legendLty <- c(legendLty, "solid") + legendLabels <- c(legendLabels, gettext("Gamma dist.")) + } else if (distribution == "exponential") { + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + scale <- distParameters$theta + rate <- 1/scale + p <- p + ggplot2::stat_function(fun = dexp , args = list(rate = rate), + mapping = ggplot2::aes(color = "exp", linetype = "exp")) + legendColors <- c(legendColors, "red") + legendLty <- c(legendLty, "solid") + legendLabels <- c(legendLabels, gettext("Exponential dist.")) + } else if (distribution == "logistic") { + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + location <- distParameters$beta + scale <- distParameters$theta + p <- p + ggplot2::stat_function(fun = dlogis , args = list(location = location, scale = scale), + mapping = ggplot2::aes(color = "logis", linetype = "logis")) + legendColors <- c(legendColors, "red") + legendLty <- c(legendLty, "solid") + legendLabels <- c(legendLabels, gettext("Logistic dist.")) + } else if (distribution == "loglogistic") { + distParameters <- .distributionParameters(data = allData, + distribution = distribution, + fix.arg = fix.arg) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + loglocation <- distParameters$beta + scale <- exp(loglocation) + shape <- 1/distParameters$theta + p <- p + ggplot2::stat_function(fun = flexsurv::dllogis , args = list(shape = shape, scale = scale), + mapping = ggplot2::aes(color = "llogis", linetype = "llogis")) + legendColors <- c(legendColors, "red") + legendLty <- c(legendLty, "solid") + legendLabels <- c(legendLabels, gettext("Log-logistic dist.")) } } From f1b4f574f50877b87dc33509e89119cb0c47a1e1 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 2 Feb 2026 19:05:28 +0100 Subject: [PATCH 20/29] adjust table fill in and update unit tests --- R/processCapabilityStudies.R | 71 +++---------------- ...capability-of-the-processl28-subplot-1.svg | 24 +++---- ...capability-of-the-processl31-subplot-1.svg | 2 +- ...capability-of-the-processl34-subplot-1.svg | 2 +- ...capability-of-the-processl37-subplot-1.svg | 2 +- .../testthat/test-processCapabilityStudies.R | 26 +++---- 6 files changed, 37 insertions(+), 90 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 31359e61..a9afcfea 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1732,6 +1732,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { colnames(tableDf) <- tableColNames + fix.arg <- .buildFixArg(options[["nonNormalDistribution"]], options) ## estimate parameters distParameters <- list() @@ -1740,70 +1741,16 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] allData <- as.vector(na.omit(unlist(dataCurrentStage[, measurements]))) - # logic that checks if all parameters necessary for the distribution are given as historical, if yes, skip the dist. est. function, else replace only the given parameters - allParametersHistorical <- switch( - options[["nonNormalDistribution"]], - "weibull" = options[["historicalShape"]] && options[["historicalScale"]], - "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], - "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], - "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], - FALSE # default - ) - if (allParametersHistorical) { - if (allParametersHistorical) { # If all are historical, assign parameters as given in options - tempDistParamList <- switch( - options[["nonNormalDistribution"]], - "weibull" = list( - beta = options[["historicalShapeValue"]], - theta = options[["historicalScaleValue"]] - ), - "lognormal" = list( - beta = options[["historicalLogMeanValue"]], - theta = options[["historicalLogStdDevValue"]] - ), - "3ParameterWeibull" = list( - beta = options[["historicalShapeValue"]], - theta = options[["historicalScaleValue"]], - threshold = options[["historicalThresholdValue"]] - ), - "3ParameterLognormal" = list( - beta = options[["historicalLogMeanValue"]], - theta = options[["historicalLogStdDevValue"]], - threshold = options[["historicalThresholdValue"]] - ), - NULL - ) - distParameters[[i]] <- tempDistParamList - } - } else { # If not all are historical, first estimate all parameters, then potentially replace some with the historical estimates - distParameters[[i]] <- try(.distributionParameters(data = allData, distribution = options[["nonNormalDistribution"]])) - if (jaspBase::isTryError(distParameters[[i]])) { - table$setError(distParameters[[i]][1]) - container[["summaryTableNonNormal"]] <- table - return() - } - ## If applicable, replace parameters with historical values - # Weibull and 3-parameter Weibull - if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { - if (options[["historicalShape"]]) { - distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] - } - if (options[["historicalScale"]]) - distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] - - # Lognormal and 3-parameter Lognormal - } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { - if (options[["historicalLogMean"]]) - distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] - if (options[["historicalLogStdDev"]]) - distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] - } + # If not all are historical, first estimate all parameters, then potentially replace some with the historical estimates + distParameters[[i]] <- try(.distributionParameters(data = allData, + distribution = options[["nonNormalDistribution"]], + fix.arg = fix.arg)) + if (jaspBase::isTryError(distParameters[[i]])) { + table$setError(distParameters[[i]][1]) + container[["summaryTableNonNormal"]] <- table + return() } } diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg index 27b6e1f6..9e012da8 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg @@ -32,20 +32,20 @@ - - - - - - - - - - + + + + + + + + + + - + @@ -56,7 +56,7 @@ USL = 12 - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg index 07c141b6..32ce1364 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg @@ -45,7 +45,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg index 360c0b6a..05d6f570 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg @@ -45,7 +45,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg index e8afcfbc..b632b93c 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg @@ -45,7 +45,7 @@ - + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index 3f7a05e8..b17f4cef 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -1904,8 +1904,8 @@ results <- runAnalysis("processCapabilityStudies", test_that("LF28.1 Weibull distribution with one historical param. - Non-conformance statistics table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(0, 0, "ppm < LSL", 1.53, 10000, "ppm > USL", 1.53, 10000, - "Total ppm")) + list(0, 0, "ppm < LSL", 41, 10000, "ppm > USL", 41, 10000, "Total ppm" + )) }) test_that("LF28.2 Weibull distribution with one historical param. - Capability of the process plot matches", { @@ -1917,13 +1917,13 @@ test_that("LF28.2 Weibull distribution with one historical param. - Capability o test_that("LF28.3 Weibull distribution with one historical param. - Process performance (total) table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list("", 1.56, "", 1.56)) + list("", 1.31, "", 1.31)) }) test_that("LF28.4 Weibull distribution with one historical param. - Process summary table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(6, 0, 7.08, 100, 1.85635681000733, 6, 7.78727631111372, 12)) + list(6, 0, 7.08, 100, 1.85635681000733, 6, 8.16170213506214, 12)) }) ### Weibull distribution with all historical param. (verified with other software) #### @@ -2055,7 +2055,7 @@ results <- runAnalysis("processCapabilityStudies", test_that("LF31.1 Lognormal distribution with one historical param. - Non-conformance statistics table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(0, 0, "ppm < LSL", 37860.93, 10000, "ppm > USL", 37860.93, + list(0, 0, "ppm < LSL", 43152.01, 10000, "ppm > USL", 43152.01, 10000, "Total ppm")) }) @@ -2068,13 +2068,13 @@ test_that("LF31.2 Lognormal distribution with one historical param. - Capability test_that("LF31.3 Lognormal distribution with one historical param. - Process performance (total) table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list("", 0.59, "", 0.59)) + list("", 0.57, "", 0.57)) }) test_that("LF31.4 Lognormal distribution with one historical param. - Process summary table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.273022707246043, 12)) + list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.28270735296668, 12)) }) ### Lognormal distribution with all historical param. (verified with other software) #### @@ -2206,7 +2206,7 @@ results <- runAnalysis("processCapabilityStudies", test_that("LF34.1 3ParameterWeibull distribution with one historical param. - Non-conformance statistics table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(0, 0, "ppm < LSL", 11678.25, 10000, "ppm > USL", 11678.25, + list(0, 0, "ppm < LSL", 8933.26, 10000, "ppm > USL", 8933.26, 10000, "Total ppm")) }) @@ -2219,13 +2219,13 @@ test_that("LF34.2 3ParameterWeibull distribution with one historical param. - Ca test_that("LF34.3 3ParameterWeibull distribution with one historical param. - Process performance (total) table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list("", 0.76, "", 0.76)) + list("", 0.79, "", 0.79)) }) test_that("LF34.4 3ParameterWeibull distribution with one historical param. - Process summary table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(2.64846838111814, 0, 7.08, 100, 1.85635681000733, 6, 5.1219561122954, + list(2.29990085720292, 0, 7.08, 100, 1.85635681000733, 6, 4.58450737688268, 3, 12)) }) @@ -2362,7 +2362,7 @@ results <- runAnalysis("processCapabilityStudies", test_that("LF37.1 3ParameterLognormal distribution with one historical param. - Non-conformance statistics table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(0.12, 0, "ppm < LSL", 9380.21, 10000, "ppm > USL", 9380.33, + list(0.15, 0, "ppm < LSL", 8891.54, 10000, "ppm > USL", 8891.69, 10000, "Total ppm")) }) @@ -2375,13 +2375,13 @@ test_that("LF37.2 3ParameterLognormal distribution with one historical param. - test_that("LF37.3 3ParameterLognormal distribution with one historical param. - Process performance (total) table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(1.25, 0.78, 1.72, 0.78)) + list(1.25, 0.79, 1.71, 0.79)) }) test_that("LF37.4 3ParameterLognormal distribution with one historical param. - Process summary table results match", { table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] jaspTools::expect_equal_tables(table, - list(2.70930280255199, 0, 7.08, 100, 1.85635681000733, 6, 0.121871527001624, + list(2.70589917129945, 0, 7.08, 100, 1.85635681000733, 6, 0.122287084346575, -8, 12)) }) From 01c7a062bdd6be1a89d5758a75a0af5f6bb51c48 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Tue, 3 Feb 2026 18:02:25 +0100 Subject: [PATCH 21/29] Make new distributions functional for tables --- R/commonQualityControl.R | 4 +- R/processCapabilityStudies.R | 227 ++++++++++++++++++++++++++++++++++- 2 files changed, 226 insertions(+), 5 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 06421266..6ddb9bec 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1680,8 +1680,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { loglogPars[names(fix.arg)] <- fix.arg } - beta <- log(logPars[["scale"]]) # log(scale) -> loglocation - theta <- 1/logPars[["shape"]] # 1/shape -> Scale + beta <- log(loglogPars[["scale"]]) # log(scale) -> loglocation + theta <- 1/loglogPars[["shape"]] # 1/shape -> Scale } } list <- list(beta = beta, diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index a9afcfea..c75b614b 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1707,9 +1707,14 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table$addColumnInfo(name = "n", type = "integer", title = gettext("Sample size")) table$addColumnInfo(name = "mean", type = "number", title = gettext("Mean")) table$addColumnInfo(name = "sd", type = "number", title = gettext("Std. dev.")) - if (options[["nonNormalDistribution"]] == "3ParameterLognormal" | options[["nonNormalDistribution"]] == "lognormal") { + if (options[["nonNormalDistribution"]] == "exponential") { + table$addColumnInfo(name = "theta", type = "number", title = gettextf("Scale (%1$s)", "\u03B8")) + } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal" || options[["nonNormalDistribution"]] == "lognormal") { table$addColumnInfo(name = "beta", type = "number", title = gettextf("Log mean (%1$s)", "\u03BC")) table$addColumnInfo(name = "theta", type = "number", title = gettextf("Log std.dev (%1$s)", "\u03C3")) + } else if (options[["nonNormalDistribution"]] == "logistic" || options[["nonNormalDistribution"]] == "loglogistic") { + table$addColumnInfo(name = "beta", type = "number", title = gettext("Location")) + table$addColumnInfo(name = "theta", type = "number", title = gettextf("Scale (%1$s)", "\u03B8")) } else { table$addColumnInfo(name = "beta", type = "number", title = gettextf("Shape (%1$s)", "\u03B2")) table$addColumnInfo(name = "theta", type = "number", title = gettextf("Scale (%1$s)", "\u03B8")) @@ -1872,6 +1877,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["nonNormalDistribution"]] == "3ParameterLognormal" | options[["nonNormalDistribution"]] == "3ParameterWeibull") threshold <- distParameters[[i]]$threshold + # calculation of capability indices + + ##################### + #### lognormal ##### + ##################### if (options[["nonNormalDistribution"]] == "lognormal") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { if (options[['nonNormalMethod' ]] == "nonConformance") { @@ -1901,6 +1911,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { ppu <- NA } tableDfCurrentStage2[["ppu"]] <- round(ppu, .numDecimals) + ##################### + #### weibull ##### + ##################### } else if (options[["nonNormalDistribution"]] == "weibull") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { if (options[['nonNormalMethod' ]] == "nonConformance") { @@ -1931,6 +1944,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { ppu <- NA } tableDfCurrentStage2[["ppu"]] <- round(ppu, .numDecimals) + ################################## + #### 3-parameter lognormal ##### + ################################## } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { if(options[['nonNormalMethod' ]] == "nonConformance") { @@ -1960,6 +1976,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { ppu <- NA } tableDfCurrentStage2[["ppu"]] <- round(ppu, .numDecimals) + ################################## + #### 3-parameter weibull ##### + ################################## } else if (options[["nonNormalDistribution"]] == "3ParameterWeibull") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]){ if (options[['nonNormalMethod' ]] == "nonConformance") { @@ -1988,6 +2007,131 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else { ppu <- NA } + #################### + #### Gamma ##### + #################### + } else if (options[["nonNormalDistribution"]] == "gamma") { + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]){ + if (options[['nonNormalMethod' ]] == "nonConformance") { + p1 <- pgamma(q = lsl, shape = beta, scale = theta, lower.tail = TRUE) + zLSL <- qnorm(p1) + ppl <- -zLSL/3 + } else { + x135 <- qgamma(p = 0.00135, shape = beta, scale = theta) + x05 <- qgamma(p = 0.5, shape = beta, scale = theta) + ppl <- (x05 - lsl) / (x05 - x135) + } + } else { + ppl <- NA + } + tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + if (options[['nonNormalMethod' ]] == "nonConformance") { + p2 <- pgamma(q = usl, shape = beta, scale = theta, lower.tail = TRUE) + zUSL <- qnorm(p2) + ppu <- zUSL/3 + } else { + x99 <- qgamma(p = 0.99865, shape = beta, scale = theta) + x05 <- qgamma(p = 0.5, shape = beta, scale = theta) + ppu <- (usl - x05) / (x99 - x05) + } + } else { + ppu <- NA + } + ########################## + #### Exponential ##### + ########################## + } else if (options[["nonNormalDistribution"]] == "exponential") { + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]){ + if (options[['nonNormalMethod' ]] == "nonConformance") { + p1 <- pexp(q = lsl, rate = 1/theta, lower.tail = TRUE) + zLSL <- qnorm(p1) + ppl <- -zLSL/3 + } else { + + x135 <- qexp(p = 0.00135, rate = 1/theta) + x05 <- qexp(p = 0.5, rate = 1/theta) + ppl <- (x05 - lsl) / (x05 - x135) + } + } else { + ppl <- NA + } + tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + if (options[['nonNormalMethod' ]] == "nonConformance") { + p2 <- pexp(q = usl, rate = 1/theta, lower.tail = TRUE) + zUSL <- qnorm(p2) + ppu <- zUSL/3 + } else { + x99 <- qexp(p = 0.99865, rate = 1/theta) + x05 <- qexp(p = 0.5, rate = 1/theta) + ppu <- (usl - x05) / (x99 - x05) + } + } else { + ppu <- NA + } + ####################### + #### Logistic ##### + ####################### + } else if (options[["nonNormalDistribution"]] == "logistic") { + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]){ + if (options[['nonNormalMethod' ]] == "nonConformance") { + p1 <- plogis(q = lsl, location = beta, scale = theta, lower.tail = TRUE) + zLSL <- qnorm(p1) + ppl <- -zLSL/3 + } else { + x135 <- qlogis(p = 0.00135, location = beta, scale = theta) + x05 <- qlogis(p = 0.5, location = beta, scale = theta) + ppl <- (x05 - lsl) / (x05 - x135) + } + } else { + ppl <- NA + } + tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + if (options[['nonNormalMethod' ]] == "nonConformance") { + p2 <- plogis(q = usl, location = beta, scale = theta, lower.tail = TRUE) + zUSL <- qnorm(p2) + ppu <- zUSL/3 + } else { + x99 <- qlogis(p = 0.99865, location = beta, scale = theta) + x05 <- qlogis(p = 0.5, location = beta, scale = theta) + ppu <- (usl - x05) / (x99 - x05) + } + } else { + ppu <- NA + } + ########################### + #### Log-Logistic ##### + ########################### + } else if (options[["nonNormalDistribution"]] == "loglogistic") { + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]){ + if (options[['nonNormalMethod' ]] == "nonConformance") { + p1 <- flexsurv::pllogis(q = lsl, shape = 1/theta, scale = exp(beta), lower.tail = TRUE) + zLSL <- qnorm(p1) + ppl <- -zLSL/3 + } else { + x135 <- flexsurv::qllogis(p = 0.00135, shape = 1/theta, scale = exp(beta)) + x05 <- flexsurv::qllogis(p = 0.5, shape = 1/theta, scale = exp(beta)) + ppl <- (x05 - lsl) / (x05 - x135) + } + } else { + ppl <- NA + } + tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + if (options[['nonNormalMethod' ]] == "nonConformance") { + p2 <- flexsurv::pllogis(q = usl, shape = 1/theta, scale = exp(beta), lower.tail = TRUE) + zUSL <- qnorm(p2) + ppu <- zUSL/3 + } else { + x99 <- flexsurv::qllogis(p = 0.99865, shape = 1/theta, scale = exp(beta)) + x05 <- flexsurv::qllogis(p = 0.5, shape = 1/theta, scale = exp(beta)) + ppu <- (usl - x05) / (x99 - x05) + } + } else { + ppu <- NA + } } tableDfCurrentStage2[["ppu"]] <- round(ppu, .numDecimals) if (options[["upperSpecificationLimit"]] && options[["lowerSpecificationLimit"]] && @@ -2099,8 +2243,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { observed <- c(oLSL, oUSL, oTOT) # expected total + + ##################### + #### lognormal ##### + ##################### if (options[["nonNormalDistribution"]] == "lognormal") { - distname <- "lognormal" + distname <- "log-normal" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { eoLSL <- 1e6 * plnorm(q = lsl, meanlog = beta, sdlog = theta, lower.tail = TRUE) } else { @@ -2111,6 +2259,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else { eoUSL <- NA } + ##################### + #### weibull ##### + ##################### } else if (options[["nonNormalDistribution"]] == "weibull") { distname <- "Weibull" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { @@ -2123,6 +2274,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else { eoUSL <- NA } + ################################### + #### 3 parameter lognormal ##### + ################################### } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { distname <- "3-parameter-lognormal" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { @@ -2135,6 +2289,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else { eoUSL <- NA } + ################################### + #### 3 parameter weibull ##### + ################################### } else if (options[["nonNormalDistribution"]] == "3ParameterWeibull") { distname <- "3-parameter-Weibull" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { @@ -2147,6 +2304,68 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else { eoUSL <- NA } + ##################### + #### gamma ##### + ##################### + } else if (options[["nonNormalDistribution"]] == "gamma") { + distname <- "gamma" + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { + + eoLSL <- 1e6 * pgamma(q = lsl, shape = beta, scale = theta, lower.tail = TRUE) + } else { + eoLSL <- NA + } + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + eoUSL <- 1e6 * (1 - pgamma(q = usl, shape = beta, scale = theta, lower.tail = TRUE)) + } else { + eoUSL <- NA + } + ########################### + #### exponential ##### + ########################### + } else if (options[["nonNormalDistribution"]] == "exponential") { + distname <- "exponential" + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { + + eoLSL <- 1e6 * pexp(q = lsl, rate = 1/theta, lower.tail = TRUE) + } else { + eoLSL <- NA + } + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + eoUSL <- 1e6 * (1 - pexp(q = usl, rate = 1/theta, lower.tail = TRUE)) + } else { + eoUSL <- NA + } + ######################## + #### logistic ##### + ######################## + } else if (options[["nonNormalDistribution"]] == "logistic") { + distname <- "logistic" + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { + eoLSL <- 1e6 * plogis(q = lsl, location = beta, scale = theta, lower.tail = TRUE) + } else { + eoLSL <- NA + } + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + eoUSL <- 1e6 * (1 - plogis(q = usl, location = beta, scale = theta, lower.tail = TRUE)) + } else { + eoUSL <- NA + } + ############################ + #### Log-logistic ##### + ############################# + } else if (options[["nonNormalDistribution"]] == "loglogistic") { + distname <- "log-logistic" + if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { + eoLSL <- 1e6 * flexsurv::pllogis(q = lsl, shape = 1/theta, scale = exp(beta), lower.tail = TRUE) + } else { + eoLSL <- NA + } + if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { + eoUSL <- 1e6 * (1 - flexsurv::pllogis(q = usl, shape = 1/theta, scale = exp(beta), lower.tail = TRUE)) + } else { + eoUSL <- NA + } } eoTOT <- if (!(options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]])) sum(c(eoLSL, eoUSL), na.rm = TRUE) else NA @@ -2202,7 +2421,9 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } # Add remaining footnotes - footnotes <- paste0(footnotes, gettextf("Calculations based on %s distribution.", distname)) + footnotes <- paste0(footnotes, gettextf("Calculations based on %s distribution. ", distname)) + if (options[["nonNormalDistribution"]] == "loglogistic") + footnotes <- paste0(footnotes, gettextf("Location parameter is log-transformed. ")) if (options[["historicalShape"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) footnotes <- paste0(footnotes, gettextf("The shape (%1$s) is based on a historical value. ", "\u03B2")) if (options[["historicalScale"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) From df9aa2bc70876805086ef0885852b5f501328bf5 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 4 Feb 2026 16:47:22 +0100 Subject: [PATCH 22/29] Finalize implementation of functionality --- R/commonQualityControl.R | 3 +- R/processCapabilityStudies.R | 68 ++++++++++++--- inst/qml/processCapabilityStudies.qml | 14 +++- .../histogram5-subplot-1.svg | 2 +- .../histogram5-subplot-2.svg | 2 +- .../histogram6-subplot-1.svg | 74 ++++++++--------- .../histogram6-subplot-2.svg | 82 +++++++++---------- .../histogram7-subplot-1.svg | 2 +- .../histogram7-subplot-2.svg | 2 +- .../histogram8-subplot-1.svg | 74 ++++++++--------- .../histogram8-subplot-2.svg | 82 +++++++++---------- .../histogramw4-subplot-1.svg | 82 +++++++++---------- .../histogramw6-subplot-1.svg | 82 +++++++++---------- 13 files changed, 309 insertions(+), 260 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 6ddb9bec..49db0688 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1667,8 +1667,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { control = list( maxit = 10000, abstol = .Machine$double.eps^0.75, - reltol = .Machine$double.eps^0.75, - ndeps = rep(1e-8, 2)), + reltol = .Machine$double.eps^0.75), start = loglogStartList, fix.arg = fix.arg)) if (jaspBase::isTryError(loglogFit)) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index c75b614b..7f9ad2e7 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -132,8 +132,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } } - - # Report if (options[["report"]]) { nElements <- sum(options[["reportProcessStability"]]*2, options[["reportProcessCapabilityPlot"]], options[["reportProbabilityPlot"]], @@ -2424,14 +2422,23 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { footnotes <- paste0(footnotes, gettextf("Calculations based on %s distribution. ", distname)) if (options[["nonNormalDistribution"]] == "loglogistic") footnotes <- paste0(footnotes, gettextf("Location parameter is log-transformed. ")) - if (options[["historicalShape"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + + # Shape + if (options[["historicalShape"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull" || options[["nonNormalDistribution"]] == "gamma")) footnotes <- paste0(footnotes, gettextf("The shape (%1$s) is based on a historical value. ", "\u03B2")) - if (options[["historicalScale"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + # Scale + if (options[["historicalScale"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull"|| options[["nonNormalDistribution"]] == "gamma" || options[["nonNormalDistribution"]] == "exponential" || options[["nonNormalDistribution"]] == "logistic" || options[["nonNormalDistribution"]] == "loglogistic")) footnotes <- paste0(footnotes, gettextf("The scale (%1$s) is based on a historical value. ", "\u03B8")) + # Location + if (options[["historicalLocation"]] && (options[["nonNormalDistribution"]] == "logistic" || options[["nonNormalDistribution"]] == "loglogistic" )) + footnotes <- paste0(footnotes, gettext("The location parameter is based on a historical value. ")) + # Log Mean if (options[["historicalLogMean"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) footnotes <- paste0(footnotes, gettextf("The log mean (%1$s) is based on a historical value. ", "\u03BC")) + # Log Std. Dev. if (options[["historicalLogStdDev"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) footnotes <- paste0(footnotes, gettextf("The log std. dev. (%1$s) is based on a historical value. ", "\u03C3")) + # Threshold if (options[["historicalThreshold"]] && (options[["nonNormalDistribution"]] == "3ParameterWeibull" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) footnotes <- paste0(footnotes, gettext("The threshold is based on a historical value. ")) @@ -2475,6 +2482,14 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (!identical(stages, "")) { nStages <- length(unique(dataset[[stages]])) } + if (options[["nullDistribution"]] %in% c("gamma", "exponential", "logistic", "loglogistic")) { + plot <- createJaspPlot(width = 400, height = 400, + title = gettext("Probability plot")) + container[["plot"]] <- plot + plot$setError(gettextf("Probability plot and table for %s distribution are not implemented in Quality Control module. Please use the Distributions module.", options[["nullDistribution"]])) + return() + } + if (sum(!is.na(dataset[measurements])) < 2) { plot <- createJaspPlot(width = 400, height = 400, title = gettext("Probability plot")) @@ -2917,21 +2932,48 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { mapping = ggplot2::aes(color = "normalDist")) legendLabel <- gettext("Normal dist.") } else if (options[['nullDistribution']] == "weibull") { - fit_Weibull <- fitdistrplus::fitdist(dataCurrentStage, "weibull", method = "mle", - control = list(maxit = 500, abstol = .Machine$double.eps, reltol = .Machine$double.eps)) - shape <- fit_Weibull$estimate[[1]] - scale <- fit_Weibull$estimate[[2]] + fit_Weibull <- .distributionParameters(dataCurrentStage, distribution = "weibull", fix.arg = NULL) + shape <- fit_Weibull[["beta"]] + scale <- fit_Weibull[["theta"]] p <- p + ggplot2::stat_function(fun = dweibull, args = list(shape = shape, scale = scale), mapping = ggplot2::aes(color = "weibullDist")) legendLabel <- gettext("Weibull dist.") } else if(options[['nullDistribution']] == "lognormal") { - fit_Lnorm <- EnvStats::elnorm(dataCurrentStage) - shape <- fit_Lnorm$parameters[1] - scale <- fit_Lnorm$parameters[2] - p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = shape, sdlog = scale), + fit_Lnorm <- .distributionParameters(dataCurrentStage, distribution = "lognormal", fix.arg = NULL) + meanlog <- fit_Lnorm[["beta"]] + sdlog <- fit_Lnorm[["theta"]] + p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = meanlog, sdlog = sdlog), mapping = ggplot2::aes(color = "lognormallDist")) - legendLabel <- gettext("Lognormal dist.") + legendLabel <- gettext("Log-normal dist.") + } else if(options[['nullDistribution']] == "gamma") { + fitGamma <- .distributionParameters(dataCurrentStage, distribution = "gamma", fix.arg = NULL) + shape <- fitGamma[["beta"]] + scale <- fitGamma[["theta"]] + p <- p + ggplot2::stat_function(fun = dgamma, args = list(shape = shape, scale = scale), + mapping = ggplot2::aes(color = "gammaDist")) + legendLabel <- gettext("Gamma dist.") + } else if(options[['nullDistribution']] == "exponential") { + fitExp <- .distributionParameters(dataCurrentStage, distribution = "exponential", fix.arg = NULL) + rate <- 1/fitExp[["theta"]] + p <- p + ggplot2::stat_function(fun = dexp, args = list(rate = rate), + mapping = ggplot2::aes(color = "exponentialDist")) + legendLabel <- gettext("Exponential dist.") + } else if(options[['nullDistribution']] == "logistic") { + fitLogis <- .distributionParameters(dataCurrentStage, distribution = "logistic", fix.arg = NULL) + location <- fitLogis[["beta"]] + scale <- fitLogis[["theta"]] + p <- p + ggplot2::stat_function(fun = dlogis, args = list(location = location, scale = scale), + mapping = ggplot2::aes(color = "logisticDist")) + legendLabel <- gettext("Logistic dist.") + } else if(options[['nullDistribution']] == "loglogistic") { + fitLoglogis <- .distributionParameters(dataCurrentStage, distribution = "logistic", fix.arg = NULL) + shape <- 1/fitLoglogis[["theta"]] + scale <- exp(fitLoglogis[["beta"]]) + p <- p + ggplot2::stat_function(fun = flexsurv::dllogis, args = list(shape = shape, scale = scale), + mapping = ggplot2::aes(color = "loglogisticDist")) + legendLabel <- gettext("Log-logistic dist.") } + p <- p + ggplot2::scale_color_manual("", values = "dodgerblue", labels = legendLabel) + ggplot2::theme(legend.position = "right") } diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index 1e557d81..e3bb1206 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -957,12 +957,20 @@ Form values: [ { label: qsTr("Normal"), value: "normal" }, - { label: qsTr("Lognormal"), value: "lognormal" }, - { label: qsTr("Weibull"), value: "weibull" } + { label: qsTr("Log-normal"), value: "lognormal" }, + { label: qsTr("Weibull"), value: "weibull" }, + { label: qsTr("Gamma"), value: "gamma" }, + { label: qsTr("Exponential"), value: "exponential"}, + { label: qsTr("Logistic"), value: "logistic" }, + { label: qsTr("Log-logistic"), value: "loglogistic"} ] indexDefaultValue: (capabilityStudyType.value == "nonNormalCapabilityAnalysis") ? (nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal") ? 1 : - (nonNormalDistribution.currentValue == "3ParameterWeibull" || nonNormalDistribution.currentValue == "weibull") ? 2 : 0 + (nonNormalDistribution.currentValue == "3ParameterWeibull" || nonNormalDistribution.currentValue == "weibull") ? 2 : + (nonNormalDistribution.currentValue == "gamma") ? 3 : + (nonNormalDistribution.currentValue == "exponential") ? 4 : + (nonNormalDistribution.currentValue == "logistic") ? 5 : + (nonNormalDistribution.currentValue == "loglogistic") ? 6 : 0 : 0 } diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-1.svg index 1266f2b1..e2bb9244 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-1.svg @@ -39,7 +39,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-2.svg index 183ca85d..6d5a7723 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram5-subplot-2.svg @@ -41,7 +41,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-1.svg index eb1eea69..2c9db6d0 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-1.svg @@ -21,26 +21,26 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -60,26 +60,26 @@ - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement + + + + + + + +2 +4 +6 +8 +10 +12 +Measurement Counts - - - - -Lognormal dist. -1 + + + + +Log-normal dist. +1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-2.svg index 9163b84f..f30bf4ff 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram6-subplot-2.svg @@ -21,28 +21,28 @@ - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -58,28 +58,28 @@ - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement Counts - - - - -Lognormal dist. -2 + + + + +Log-normal dist. +2 diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-1.svg index 1266f2b1..e2bb9244 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-1.svg @@ -39,7 +39,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-2.svg index 183ca85d..6d5a7723 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram7-subplot-2.svg @@ -41,7 +41,7 @@ - + diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-1.svg index eb1eea69..2c9db6d0 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-1.svg @@ -21,26 +21,26 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -60,26 +60,26 @@ - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement + + + + + + + +2 +4 +6 +8 +10 +12 +Measurement Counts - - - - -Lognormal dist. -1 + + + + +Log-normal dist. +1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-2.svg index 9163b84f..f30bf4ff 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogram8-subplot-2.svg @@ -21,28 +21,28 @@ - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -58,28 +58,28 @@ - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement Counts - - - - -Lognormal dist. -2 + + + + +Log-normal dist. +2 diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogramw4-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogramw4-subplot-1.svg index e3b24091..64423a3d 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogramw4-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogramw4-subplot-1.svg @@ -21,28 +21,28 @@ - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -60,28 +60,28 @@ - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement Counts - - - - -Lognormal dist. -histogramW4-subplot-1 + + + + +Log-normal dist. +histogramW4-subplot-1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/histogramw6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/histogramw6-subplot-1.svg index 8fb1a34f..8dedb588 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/histogramw6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/histogramw6-subplot-1.svg @@ -21,28 +21,28 @@ - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -60,28 +60,28 @@ - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement Counts - - - - -Lognormal dist. -histogramW6-subplot-1 + + + + +Log-normal dist. +histogramW6-subplot-1 From 1d312a2ae426c20fa15a5e7c8f18d5e12644686d Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 5 Feb 2026 16:45:37 +0100 Subject: [PATCH 23/29] Adjust helpfile --- inst/help/processCapabilityStudies.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/help/processCapabilityStudies.md b/inst/help/processCapabilityStudies.md index 2a3dca87..08bf87c8 100644 --- a/inst/help/processCapabilityStudies.md +++ b/inst/help/processCapabilityStudies.md @@ -46,10 +46,10 @@ The size of the subgroups is relevant for the calculation of the process varianc - **Continuity Adjustment** if enabled, the Box-Cox transform includes the adjustment term $y = \frac{(x+\text{shift})^\lambda-1}{\lambda}$. #### Type of data distribution -- Type of data distribution: indicate whether the data approximates a normal distribution or another distribution (the most commonly used distributions are: Weibull, Lognormal, 3-parameter Weibull, and 3-parameter lognorma) +- Type of data distribution: indicate whether the data approximates a normal distribution or another distribution (the available distributions are: Weibull, Lognormal, Gamma, Exponential, Logistic, Log-logistic, 3-parameter Weibull, and 3-parameter lognormal) - Specify a distribution: the non-normal distribution to be used. - Non-normal capability statistics: the method used to calculate the capability statistics for non-normally distributed data. - - Historical parameters: Select which parameters should use fixed historical values instead of being estimated. Note that if only some parameters are set historically, JASP currently estimates all parameters first and then replaces the selected ones with their historical values; it does not keep them fixed during estimation. + - Historical parameters: Select which parameters should use fixed historical values instead of being estimated. Note that if not all parameters are set historically, JASP keeps the historical parameters fixed while estimating the remaining parameters freely. #### Capability studies - Specification limits: From 6794ed6eb52f53ff9b852448a4ab524d5e50c880 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 5 Feb 2026 17:15:54 +0100 Subject: [PATCH 24/29] Inital unit test setup --- R/processCapabilityStudies.R | 2 +- .../testthat/test-processCapabilityStudies.R | 385 ++++++++++++++++++ 2 files changed, 386 insertions(+), 1 deletion(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 7f9ad2e7..eaef7bd0 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -754,7 +754,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # GUI scale → shape if (options[["historicalScale"]]) { - fix.arg[["shape"]] <- options[["historicalScaleValue"]] # to match the parameters of other software + fix.arg[["shape"]] <- 1/options[["historicalScaleValue"]] # to match the parameters of other software } # GUI location → scale diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index b17f4cef..192c5a72 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -2491,6 +2491,391 @@ test_that("LF39.4 3ParameterLognormal distribution with mismatching historical d list(4, 0, 7.08, 100, 1.85635681000733, 6, 0.12, -8, 12)) }) +## Test Additional Non-normal Distributions #### + +### Basic Tests #### + +#### Gamma #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "gamma" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +#### Exponential #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "exponential" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +#### Logistic #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "logistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +#### Log-logistic #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "loglogistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +### Historical Parameter Tests + +#### Gamma #### + +##### Single Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "gamma" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 14 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +##### All Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "gamma" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 14 +options$historicalScale <- TRUE +options$historicalScaleValue <- 5 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +##### Extreme Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "gamma" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 50 +options$historicalScale <- TRUE +options$historicalScaleValue <- 13 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +#### Exponential #### + +##### Single Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "exponential" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalScale <- TRUE +options$historicalScaleValue <- 8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +##### Extreme Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "exponential" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalScale <- TRUE +options$historicalScaleValue <- 99 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +#### Logistic #### + +##### Single Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "logistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalScale <- TRUE +options$historicalScaleValue <- 1 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +##### All Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "logistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalScale <- TRUE +options$historicalScaleValue <- 1 +options$historicalLocation <- TRUE +options$historicalLocationValue <- 7 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +##### Extreme Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "logistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalScale <- TRUE +options$historicalScaleValue <- 10 +options$historicalLocation <- TRUE +options$historicalLocationValue <- 70 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + +#### Log-logistic #### + +##### Single Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "loglogistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLocation <- TRUE +options$historicalLocationValue <- exp(2) +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +##### All Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "loglogistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLocation <- TRUE +options$historicalLocationValue <- exp(2) +options$historicalScale <- TRUE +options$historicalScaleValue <- 0.15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + + +##### Extreme Historical Parameter #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "loglogistic" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 4 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLocation <- TRUE +options$historicalLocationValue <- exp(20) +options$historicalScale <- TRUE +options$historicalScaleValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + # Wide / Row format #### ## (Normal) Basic tests #### From d659209f596f032aa5591cffa00eeb435306b239 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 6 Feb 2026 15:54:30 +0100 Subject: [PATCH 25/29] Unit tests --- R/processCapabilityStudies.R | 10 +- ...capability-of-the-processl40-subplot-1.svg | 90 +++ ...capability-of-the-processl41-subplot-1.svg | 90 +++ ...capability-of-the-processl42-subplot-1.svg | 90 +++ ...capability-of-the-processl43-subplot-1.svg | 90 +++ ...capability-of-the-processl44-subplot-1.svg | 90 +++ ...capability-of-the-processl45-subplot-1.svg | 90 +++ ...capability-of-the-processl46-subplot-1.svg | 705 ++++++++++++++++++ ...capability-of-the-processl47-subplot-1.svg | 90 +++ ...capability-of-the-processl48-subplot-1.svg | 90 +++ ...capability-of-the-processl49-subplot-1.svg | 90 +++ ...capability-of-the-processl50-subplot-1.svg | 90 +++ ...capability-of-the-processl51-subplot-1.svg | 198 +++++ ...capability-of-the-processl52-subplot-1.svg | 90 +++ ...capability-of-the-processl53-subplot-1.svg | 90 +++ ...capability-of-the-processl54-subplot-1.svg | 70 ++ .../testthat/test-processCapabilityStudies.R | 441 ++++++++++- 17 files changed, 2469 insertions(+), 35 deletions(-) create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl40-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl41-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl42-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl43-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl44-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl45-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl46-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl47-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl48-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl49-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl50-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl51-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl52-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl53-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl54-subplot-1.svg diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index eaef7bd0..4f0042f2 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -852,13 +852,21 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (distribution == "lognormal" || distribution == "3ParameterLognormal" && options[["historicalLogMean"]]) xLimits <- range(xLimits, exp(options[["historicalLogMeanValue"]]) - 1.5 * sdo, exp(options[["historicalLogMeanValue"]]) + 1.5 * sdo) + if (distribution == "exponential") + xLimits <- range(xLimits, 0) + if (distribution == "gamma" && options[["historicalShape"]] && options[["historicalScale"]]) + xLimits <- range(xLimits, options[["historicalScaleValue"]] * (options[["historicalShapeValue"]] - 1)) + if ((distribution == "logistic" || distribution == "loglogistic") && options[["historicalLocation"]]) + xLimits <- range(xLimits, options[["historicalLocationValue"]]) # Get xBreaks based on the data, with an axis that also spans the limits xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(allData)) xStep <- diff(xBreaks)[1] loExt <- min(xBreaks) - pmax(0, ceiling((min(xBreaks) - min(xLimits)) / xStep) * xStep) hiExt <- max(xBreaks) + pmax(0, ceiling((max(xLimits) - max(xBreaks)) / xStep) * xStep) - xBreaks <- seq(loExt, hiExt, by = xStep) + nBreaks <- floor((hiExt - loExt) / xStep) + 1 + if (nBreaks < 100) # if the number of breaks does not exceed 100, draw the full sequence + xBreaks <- seq(loExt, hiExt, by = xStep) # Get limits to always include all breaks xLimits <- range(xLimits, xBreaks) diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl40-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl40-subplot-1.svg new file mode 100644 index 00000000..7ccb91f2 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl40-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Gamma dist. +capability-of-the-processL40-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl41-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl41-subplot-1.svg new file mode 100644 index 00000000..6a8af853 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl41-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Exponential dist. +capability-of-the-processL41-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl42-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl42-subplot-1.svg new file mode 100644 index 00000000..ece16e3f --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl42-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Logistic dist. +capability-of-the-processL42-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl43-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl43-subplot-1.svg new file mode 100644 index 00000000..576af5d6 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl43-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Log-logistic dist. +capability-of-the-processL43-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl44-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl44-subplot-1.svg new file mode 100644 index 00000000..59bc8e93 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl44-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Gamma dist. +capability-of-the-processL44-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl45-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl45-subplot-1.svg new file mode 100644 index 00000000..e37f11f8 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl45-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Gamma dist. +capability-of-the-processL45-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl46-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl46-subplot-1.svg new file mode 100644 index 00000000..f4063dff --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl46-subplot-1.svg @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement +Density + + + + +Gamma dist. +capability-of-the-processL46-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl47-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl47-subplot-1.svg new file mode 100644 index 00000000..aed9bd2e --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl47-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Exponential dist. +capability-of-the-processL47-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl48-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl48-subplot-1.svg new file mode 100644 index 00000000..4bbad652 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl48-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Exponential dist. +capability-of-the-processL48-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl49-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl49-subplot-1.svg new file mode 100644 index 00000000..941b45b3 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl49-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Logistic dist. +capability-of-the-processL49-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl50-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl50-subplot-1.svg new file mode 100644 index 00000000..ce5e0b74 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl50-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Logistic dist. +capability-of-the-processL50-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl51-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl51-subplot-1.svg new file mode 100644 index 00000000..376616fb --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl51-subplot-1.svg @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +60 +62 +64 +66 +68 +70 +Measurement +Density + + + + +Logistic dist. +capability-of-the-processL51-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl52-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl52-subplot-1.svg new file mode 100644 index 00000000..bcc37c05 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl52-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Log-logistic dist. +capability-of-the-processL52-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl53-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl53-subplot-1.svg new file mode 100644 index 00000000..ce588e8f --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl53-subplot-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + + + +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Log-logistic dist. +capability-of-the-processL53-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl54-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl54-subplot-1.svg new file mode 100644 index 00000000..85b407a5 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl54-subplot-1.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 4 + +USL = 12 + + + + + + + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement +Density + + + + +Log-logistic dist. +capability-of-the-processL54-subplot-1 + + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index 192c5a72..ad3abd3d 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -2495,7 +2495,7 @@ test_that("LF39.4 3ParameterLognormal distribution with mismatching historical d ### Basic Tests #### -#### Gamma #### +#### Gamma (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2515,9 +2515,35 @@ options$targetValue <- 6 options$upperSpecificationLimitValue <- 12 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) -#### Exponential #### +test_that("LF40.1 Gamma distribution basic test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(30404.25, 40000, "ppm < LSL", 11716.86, 10000, "ppm > USL", + 42121.11, 50000, "Total ppm")) +}) + +test_that("LF40.2 Gamma distribution basic test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL40") +}) + +test_that("LF40.3 Gamma distribution basic test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.69, 0.62, 0.62, 0.76)) +}) + +test_that("LF40.4 Gamma distribution basic test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(14.2311221847139, 4, 7.08, 100, 1.85635681000733, 6, 0.497501377191694, + 12)) +}) + +#### Exponential (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2537,10 +2563,34 @@ options$targetValue <- 6 options$upperSpecificationLimitValue <- 12 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF41.1 Exponential distribution basic test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(431623.8, 40000, "ppm < LSL", 183614.79, 10000, "ppm > USL", + 615238.59, 50000, "Total ppm")) +}) -#### Logistic #### +test_that("LF41.2 Exponential distribution basic test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL41") +}) + +test_that("LF41.3 Exponential distribution basic test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.18, 0.06, 0.06, 0.3)) +}) + +test_that("LF41.4 Exponential distribution basic test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 7.08, 100, 1.85635681000733, 6, 7.07999998481908, 12)) +}) + +#### Logistic (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2560,10 +2610,35 @@ options$targetValue <- 6 options$upperSpecificationLimitValue <- 12 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF42.1 Logistic distribution basic test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(54498.33, 40000, "ppm < LSL", 9148.66, 10000, "ppm > USL", + 63646.99, 50000, "Total ppm")) +}) -#### Log-logistic #### +test_that("LF42.2 Logistic distribution basic test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL42") +}) + +test_that("LF42.3 Logistic distribution basic test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.66, 0.53, 0.53, 0.79)) +}) + +test_that("LF42.4 Logistic distribution basic test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(7.02823580987237, 4, 7.08, 100, 1.85635681000733, 6, 1.06121867567882, + 12)) +}) + +#### Log-logistic (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2583,14 +2658,39 @@ options$targetValue <- 6 options$upperSpecificationLimitValue <- 12 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF43.1 Log-logistic distribution basic test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(28611.73, 40000, "ppm < LSL", 27710.61, 10000, "ppm > USL", + 56322.33, 50000, "Total ppm")) +}) +test_that("LF43.2 Log-logistic distribution basic test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL43") +}) + +test_that("LF43.3 Log-logistic distribution basic test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.64, 0.63, 0.63, 0.64)) +}) + +test_that("LF43.4 Log-logistic distribution basic test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.93304670804655, 4, 7.08, 100, 1.85635681000733, 6, 0.155111026728208, + 12)) +}) ### Historical Parameter Tests #### Gamma #### -##### Single Historical Parameter #### +##### Single Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2612,10 +2712,35 @@ options$historicalShape <- TRUE options$historicalShapeValue <- 14 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF44.1 Gamma distribution single hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(31578.46, 40000, "ppm < LSL", 12250.04, 10000, "ppm > USL", + 43828.5, 50000, "Total ppm")) +}) + +test_that("LF44.2 Gamma distribution single hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL44") +}) -##### All Historical Parameter #### +test_that("LF44.3 Gamma distribution single hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.68, 0.62, 0.62, 0.75)) +}) + +test_that("LF44.4 Gamma distribution single hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(14, 4, 7.08, 100, 1.85635681000733, 6, 0.505714242599307, 12 + )) +}) + +##### All Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2636,12 +2761,37 @@ options$upperSpecificationLimitValue <- 12 options$historicalShape <- TRUE options$historicalShapeValue <- 14 options$historicalScale <- TRUE -options$historicalScaleValue <- 5 +options$historicalScaleValue <- .5 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF45.1 Gamma distribution all hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(34180.7, 40000, "ppm < LSL", 10716.11, 10000, "ppm > USL", + 44896.81, 50000, "Total ppm")) +}) + +test_that("LF45.2 Gamma distribution all hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL45") +}) -##### Extreme Historical Parameter #### +test_that("LF45.3 Gamma distribution all hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.69, 0.61, 0.61, 0.77)) +}) + +test_that("LF45.4 Gamma distribution all hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(14, 4, 7.08, 100, 1.85635681000733, 6, 0.5, 12)) +}) + +##### Extreme Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2665,11 +2815,36 @@ options$historicalScale <- TRUE options$historicalScaleValue <- 13 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF46.1 Gamma distribution extreme hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 40000, "ppm < LSL", 1e+06, 10000, "ppm > USL", 1e+06, + 50000, "Total ppm")) +}) + +test_that("LF46.2 Gamma distribution extreme hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL46") +}) + +test_that("LF46.3 Gamma distribution extreme hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.48, -5.77, 6.73, -5.77)) +}) + +test_that("LF46.4 Gamma distribution extreme hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(50, 4, 7.08, 100, 1.85635681000733, 6, 13, 12)) +}) #### Exponential #### -##### Single Historical Parameter #### +##### Single Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2691,9 +2866,34 @@ options$historicalScale <- TRUE options$historicalScaleValue <- 8 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF47.1 Exponential distribution single hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(393469.34, 40000, "ppm < LSL", 223130.16, 10000, "ppm > USL", + 616599.5, 50000, "Total ppm")) +}) -##### Extreme Historical Parameter #### +test_that("LF47.2 Exponential distribution single hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL47") +}) + +test_that("LF47.3 Exponential distribution single hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.17, 0.09, 0.09, 0.25)) +}) + +test_that("LF47.4 Exponential distribution single hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 7.08, 100, 1.85635681000733, 6, 8, 12)) +}) + +##### Extreme Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2715,11 +2915,36 @@ options$historicalScale <- TRUE options$historicalScaleValue <- 99 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF48.1 Exponential distribution extreme hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(39598.68, 40000, "ppm < LSL", 885846.03, 10000, "ppm > USL", + 925444.71, 50000, "Total ppm")) +}) + +test_that("LF48.2 Exponential distribution extreme hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL48") +}) + +test_that("LF48.3 Exponential distribution extreme hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.09, -0.4, 0.59, -0.4)) +}) + +test_that("LF48.4 Exponential distribution extreme hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 7.08, 100, 1.85635681000733, 6, 99, 12)) +}) #### Logistic #### -##### Single Historical Parameter #### +##### Single Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2741,10 +2966,34 @@ options$historicalScale <- TRUE options$historicalScaleValue <- 1 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF49.1 Logistic distribution single hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(46255.88, 40000, "ppm < LSL", 6869.35, 10000, "ppm > USL", + 53125.23, 50000, "Total ppm")) +}) -##### All Historical Parameter #### +test_that("LF49.2 Logistic distribution single hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL49") +}) + +test_that("LF49.3 Logistic distribution single hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.69, 0.56, 0.56, 0.82)) +}) + +test_that("LF49.4 Logistic distribution single hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(7.02620683920319, 4, 7.08, 100, 1.85635681000733, 6, 1, 12)) +}) + +##### All Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2768,9 +3017,34 @@ options$historicalLocation <- TRUE options$historicalLocationValue <- 7 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF50.1 Logistic distribution all hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(47425.87, 40000, "ppm < LSL", 6692.85, 10000, "ppm > USL", + 54118.72, 50000, "Total ppm")) +}) + +test_that("LF50.2 Logistic distribution all hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL50") +}) + +test_that("LF50.3 Logistic distribution all hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.69, 0.56, 0.56, 0.82)) +}) + +test_that("LF50.4 Logistic distribution all hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(7, 4, 7.08, 100, 1.85635681000733, 6, 1, 12)) +}) -##### Extreme Historical Parameter #### +##### Extreme Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2794,11 +3068,36 @@ options$historicalLocation <- TRUE options$historicalLocationValue <- 70 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF51.1 Logistic distribution extreme hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1358.52, 40000, "ppm < LSL", 996981.58, 10000, "ppm > USL", + 998340.1, 50000, "Total ppm")) +}) + +test_that("LF51.2 Logistic distribution extreme hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL51") +}) + +test_that("LF51.3 Logistic distribution extreme hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.04, -0.92, 1, -0.92)) +}) + +test_that("LF51.4 Logistic distribution extreme hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(70, 4, 7.08, 100, 1.85635681000733, 6, 10, 12)) +}) #### Log-logistic #### -##### Single Historical Parameter #### +##### Single Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2816,14 +3115,39 @@ options$upperSpecificationLimit <- TRUE options$lowerSpecificationLimitValue <- 4 options$targetValue <- 6 options$upperSpecificationLimitValue <- 12 -options$historicalLocation <- TRUE -options$historicalLocationValue <- exp(2) +options$historicalScale <- TRUE +options$historicalScaleValue <- 0.16 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF52.1 Log-logistic distribution single hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(31824.38, 40000, "ppm < LSL", 30734.71, 10000, "ppm > USL", + 62559.08, 50000, "Total ppm")) +}) + +test_that("LF52.2 Log-logistic distribution single hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL52") +}) + +test_that("LF52.3 Log-logistic distribution single hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.62, 0.62, 0.62, 0.62)) +}) + +test_that("LF52.4 Log-logistic distribution single hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.93272331323149, 4, 7.08, 100, 1.85635681000733, 6, 0.16, 12 + )) +}) -##### All Historical Parameter #### +##### All Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2844,13 +3168,37 @@ options$upperSpecificationLimitValue <- 12 options$historicalLocation <- TRUE options$historicalLocationValue <- exp(2) options$historicalScale <- TRUE -options$historicalScaleValue <- 0.15 +options$historicalScaleValue <- 0.16 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) +test_that("LF53.1 Log-logistic distribution all hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(21130.16, 40000, "ppm < LSL", 46061.16, 10000, "ppm > USL", + 67191.32, 50000, "Total ppm")) +}) + +test_that("LF53.2 Log-logistic distribution all hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL53") +}) + +test_that("LF53.3 Log-logistic distribution all hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.62, 0.56, 0.68, 0.56)) +}) + +test_that("LF53.4 Log-logistic distribution all hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.000005941346, 4, 7.08, 100, 1.85635681000733, 6, 0.16, 12)) +}) -##### Extreme Historical Parameter #### +##### Extreme Historical Parameter (verified with other software) #### options <- analysisOptions("processCapabilityStudies") options$measurementLongFormat <- "Diameter" options$subgroupSizeType <- "manual" @@ -2874,7 +3222,32 @@ options$historicalScale <- TRUE options$historicalScaleValue <- 15 set.seed(1) results <- runAnalysis("processCapabilityStudies", - "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options, makeTests = T) + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF54.1 Log-logistic distribution extreme hist. param. test - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(224276.98, 40000, "ppm < LSL", 762724.12, 10000, "ppm > USL", + 987001.1, 50000, "Total ppm")) +}) + +test_that("LF54.2 Log-logistic distribution extreme hist. param. test - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL54") +}) + +test_that("LF54.3 Log-logistic distribution extreme hist. param. test - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.01, -0.24, 0.25, -0.24)) +}) + +test_that("LF54.4 Log-logistic distribution extreme hist. param. test - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(20, 4, 7.08, 100, 1.85635681000733, 6, 15, 12)) +}) # Wide / Row format #### From fd1e565fed64b5a6ecc8778c94de8308e68938f2 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 9 Feb 2026 17:34:58 +0100 Subject: [PATCH 26/29] Add flexsurv to DESCRIPTION and lockfile --- DESCRIPTION | 3 +- renv.lock | 1838 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 1643 insertions(+), 198 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 72b16dc8..dae0b00b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,7 +37,8 @@ Imports: tibble, vipor, weibullness, - utils + utils, + flexsurv Remotes: jasp-stats/jaspBase, jasp-stats/jaspDescriptives, diff --git a/renv.lock b/renv.lock index 81b9db31..a79bc1d9 100644 --- a/renv.lock +++ b/renv.lock @@ -148,29 +148,82 @@ "Package": "MASS", "Version": "7.3-65", "Source": "Repository", - "Requirements": [ - "methods", - "R", + "Priority": "recommended", + "Date": "2025-02-19", + "Revision": "$Rev: 3681 $", + "Depends": [ + "R (>= 4.4.0)", "grDevices", "graphics", "stats", "utils" - ] + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "lattice", + "nlme", + "nnet", + "survival" + ], + "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"), email = \"Brian.Ripley@R-project.org\"), person(\"Bill\", \"Venables\", role = c(\"aut\", \"cph\")), person(c(\"Douglas\", \"M.\"), \"Bates\", role = \"ctb\"), person(\"Kurt\", \"Hornik\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"Albrecht\", \"Gebhardt\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"David\", \"Firth\", role = \"ctb\", comment = \"support functions for polr\"))", + "Description": "Functions and datasets to support Venables and Ripley, \"Modern Applied Statistics with S\" (4th edition, 2002).", + "Title": "Support Functions and Datasets for Venables and Ripley's MASS", + "LazyData": "yes", + "ByteCompile": "yes", + "License": "GPL-2 | GPL-3", + "URL": "http://www.stats.ox.ac.uk/pub/MASS4/", + "Contact": "", + "NeedsCompilation": "yes", + "Author": "Brian Ripley [aut, cre, cph], Bill Venables [aut, cph], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb] (support functions for polr)", + "Maintainer": "Brian Ripley ", + "Repository": "CRAN" }, "Matrix": { "Package": "Matrix", "Version": "1.7-4", "Source": "Repository", - "Requirements": [ + "VersionNote": "do also bump src/version.h, inst/include/Matrix/version.h", + "Date": "2025-08-27", + "Priority": "recommended", + "Title": "Sparse and Dense Matrix Classes and Methods", + "Description": "A rich hierarchy of sparse and dense matrix classes, including general, symmetric, triangular, and diagonal matrices with numeric, logical, or pattern entries. Efficient methods for operating on such matrices, often wrapping the 'BLAS', 'LAPACK', and 'SuiteSparse' libraries.", + "License": "GPL (>= 2) | file LICENCE", + "URL": "https://Matrix.R-forge.R-project.org", + "BugReports": "https://R-forge.R-project.org/tracker/?atid=294&group_id=61", + "Contact": "Matrix-authors@R-project.org", + "Authors@R": "c(person(\"Douglas\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"Martin\", \"Maechler\", role = c(\"aut\", \"cre\"), email = \"mmaechler+Matrix@gmail.com\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Mikael\", \"Jagan\", role = \"aut\", comment = c(ORCID = \"0000-0002-3542-2938\")), person(\"Timothy A.\", \"Davis\", role = \"ctb\", comment = c(ORCID = \"0000-0001-7614-6899\", \"SuiteSparse libraries\", \"collaborators listed in dir(system.file(\\\"doc\\\", \\\"SuiteSparse\\\", package=\\\"Matrix\\\"), pattern=\\\"License\\\", full.names=TRUE, recursive=TRUE)\")), person(\"George\", \"Karypis\", role = \"ctb\", comment = c(ORCID = \"0000-0003-2753-1437\", \"METIS library\", \"Copyright: Regents of the University of Minnesota\")), person(\"Jason\", \"Riedy\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4345-4200\", \"GNU Octave's condest() and onenormest()\", \"Copyright: Regents of the University of California\")), person(\"Jens\", \"Oehlschlägel\", role = \"ctb\", comment = \"initial nearPD()\"), person(\"R Core Team\", role = \"ctb\", comment = c(ROR = \"02zz1nj61\", \"base R's matrix implementation\")))", + "Depends": [ + "R (>= 4.4)", + "methods" + ], + "Imports": [ "grDevices", "graphics", "grid", "lattice", "stats", - "utils", - "R", - "methods" - ] + "utils" + ], + "Suggests": [ + "MASS", + "datasets", + "sfsmisc", + "tools" + ], + "Enhances": [ + "SparseM", + "graph" + ], + "LazyData": "no", + "LazyDataNote": "not possible, since we use data/*.R and our S4 classes", + "BuildResaveData": "no", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Douglas Bates [aut] (ORCID: ), Martin Maechler [aut, cre] (ORCID: ), Mikael Jagan [aut] (ORCID: ), Timothy A. Davis [ctb] (ORCID: , SuiteSparse libraries, collaborators listed in dir(system.file(\"doc\", \"SuiteSparse\", package=\"Matrix\"), pattern=\"License\", full.names=TRUE, recursive=TRUE)), George Karypis [ctb] (ORCID: , METIS library, Copyright: Regents of the University of Minnesota), Jason Riedy [ctb] (ORCID: , GNU Octave's condest() and onenormest(), Copyright: Regents of the University of California), Jens Oehlschlägel [ctb] (initial nearPD()), R Core Team [ctb] (ROR: , base R's matrix implementation)", + "Maintainer": "Martin Maechler ", + "Repository": "CRAN" }, "MatrixModels": { "Package": "MatrixModels", @@ -187,39 +240,115 @@ "Package": "R6", "Version": "2.6.1", "Source": "Repository", - "Requirements": [ - "R" - ] + "Title": "Encapsulated Classes with Reference Semantics", + "Authors@R": "c( person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Creates classes with reference semantics, similar to R's built-in reference classes. Compared to reference classes, R6 classes are simpler and lighter-weight, and they are not built on S4 classes so they do not require the methods package. These classes allow public and private members, and they support inheritance, even when the classes are defined in different packages.", + "License": "MIT + file LICENSE", + "URL": "https://r6.r-lib.org, https://github.com/r-lib/R6", + "BugReports": "https://github.com/r-lib/R6/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Suggests": [ + "lobstr", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate, ggplot2, microbenchmark, scales", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Winston Chang ", + "Repository": "CRAN" }, "RColorBrewer": { "Package": "RColorBrewer", "Version": "1.1-3", "Source": "Repository", - "Requirements": [ - "R" - ] + "Date": "2022-04-03", + "Title": "ColorBrewer Palettes", + "Authors@R": "c(person(given = \"Erich\", family = \"Neuwirth\", role = c(\"aut\", \"cre\"), email = \"erich.neuwirth@univie.ac.at\"))", + "Author": "Erich Neuwirth [aut, cre]", + "Maintainer": "Erich Neuwirth ", + "Depends": [ + "R (>= 2.0.0)" + ], + "Description": "Provides color schemes for maps (and other graphics) designed by Cynthia Brewer as described at http://colorbrewer2.org.", + "License": "Apache License 2.0", + "NeedsCompilation": "no", + "Repository": "CRAN" }, "Rcpp": { "Package": "Rcpp", "Version": "1.1.1", "Source": "Repository", - "Requirements": [ + "Title": "Seamless R and C++ Integration", + "Date": "2026-01-07", + "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"JJ\", \"Allaire\", role = \"aut\", comment = c(ORCID = \"0000-0003-0174-9868\")), person(\"Kevin\", \"Ushey\", role = \"aut\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Qiang\", \"Kou\", role = \"aut\", comment = c(ORCID = \"0000-0001-6786-5453\")), person(\"Nathan\", \"Russell\", role = \"aut\"), person(\"Iñaki\", \"Ucar\", role = \"aut\", comment = c(ORCID = \"0000-0001-6403-5550\")), person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"John\", \"Chambers\", role = \"aut\"))", + "Description": "The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries. Documentation about 'Rcpp' is provided by several vignettes included in this package, via the 'Rcpp Gallery' site at , the paper by Eddelbuettel and Francois (2011, ), the book by Eddelbuettel (2013, ) and the paper by Eddelbuettel and Balamuta (2018, ); see 'citation(\"Rcpp\")' for details.", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ "methods", - "R", "utils" - ] + ], + "Suggests": [ + "tinytest", + "inline", + "rbenchmark", + "pkgKitten (>= 0.1.2)" + ], + "URL": "https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp", + "License": "GPL (>= 2)", + "BugReports": "https://github.com/RcppCore/Rcpp/issues", + "MailingList": "rcpp-devel@lists.r-forge.r-project.org", + "RoxygenNote": "6.1.1", + "Encoding": "UTF-8", + "VignetteBuilder": "Rcpp", + "NeedsCompilation": "yes", + "Author": "Dirk Eddelbuettel [aut, cre] (ORCID: ), Romain Francois [aut] (ORCID: ), JJ Allaire [aut] (ORCID: ), Kevin Ushey [aut] (ORCID: ), Qiang Kou [aut] (ORCID: ), Nathan Russell [aut], Iñaki Ucar [aut] (ORCID: ), Doug Bates [aut] (ORCID: ), John Chambers [aut]", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "CRAN" }, "RcppArmadillo": { "Package": "RcppArmadillo", "Version": "15.2.3-1", "Source": "Repository", - "Requirements": [ - "methods", - "R", - "Rcpp", + "Type": "Package", + "Title": "'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library", + "Date": "2025-12-16", + "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"Binxiang\", \"Ni\", role = \"aut\"), person(\"Conrad\", \"Sanderson\", role = \"aut\", comment = c(ORCID = \"0000-0002-0049-4501\")))", + "Description": "'Armadillo' is a templated C++ linear algebra library aiming towards a good balance between speed and ease of use. It provides high-level syntax and functionality deliberately similar to Matlab. It is useful for algorithm development directly in C++, or quick conversion of research code into production environments. It provides efficient classes for vectors, matrices and cubes where dense and sparse matrices are supported. Integer, floating point and complex numbers are supported. A sophisticated expression evaluator (based on template meta-programming) automatically combines several operations to increase speed and efficiency. Dynamic evaluation automatically chooses optimal code paths based on detected matrix structures. Matrix decompositions are provided through integration with LAPACK, or one of its high performance drop-in replacements (such as 'MKL' or 'OpenBLAS'). It can automatically use 'OpenMP' multi-threading (parallelisation) to speed up computationally expensive operations. . The 'RcppArmadillo' package includes the header files from the 'Armadillo' library; users do not need to install 'Armadillo' itself in order to use 'RcppArmadillo'. Starting from release 15.0.0, the minimum compilation standard is C++14 so 'Armadillo' version 14.6.3 is included as a fallback when an R package forces the C++11 standard. Package authors should set a '#define' to select the 'current' version, or select the 'legacy' version (also chosen as default) if they must. See 'GitHub issue #475' for details. . Since release 7.800.0, 'Armadillo' is licensed under Apache License 2; previous releases were under licensed as MPL 2.0 from version 3.800.0 onwards and LGPL-3 prior to that; 'RcppArmadillo' (the 'Rcpp' bindings/bridge to Armadillo) is licensed under the GNU GPL version 2 or later, as is the rest of 'Rcpp'.", + "License": "GPL (>= 2)", + "LazyLoad": "yes", + "Depends": [ + "R (>= 3.3.0)" + ], + "LinkingTo": [ + "Rcpp" + ], + "Imports": [ + "Rcpp (>= 1.0.12)", "stats", - "utils" - ] + "utils", + "methods" + ], + "Suggests": [ + "tinytest", + "Matrix (>= 1.3.0)", + "pkgKitten", + "reticulate", + "slam" + ], + "URL": "https://github.com/RcppCore/RcppArmadillo, https://dirk.eddelbuettel.com/code/rcpp.armadillo.html", + "BugReports": "https://github.com/RcppCore/RcppArmadillo/issues", + "RoxygenNote": "6.0.1", + "NeedsCompilation": "yes", + "Author": "Dirk Eddelbuettel [aut, cre] (ORCID: ), Romain Francois [aut] (ORCID: ), Doug Bates [aut] (ORCID: ), Binxiang Ni [aut], Conrad Sanderson [aut] (ORCID: )", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "CRAN" }, "RcppEigen": { "Package": "RcppEigen", @@ -256,10 +385,40 @@ "Package": "S7", "Version": "0.2.1", "Source": "Repository", - "Requirements": [ - "R", + "Title": "An Object Oriented System Meant to Become a Successor to S3 and S4", + "Authors@R": "c( person(\"Object-Oriented Programming Working Group\", role = \"cph\"), person(\"Davis\", \"Vaughan\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Tomasz\", \"Kalinowski\", role = \"aut\"), person(\"Will\", \"Landau\", role = \"aut\"), person(\"Michael\", \"Lawrence\", role = \"aut\"), person(\"Martin\", \"Maechler\", role = \"aut\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Luke\", \"Tierney\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")) )", + "Description": "A new object oriented programming system designed to be a successor to S3 and S4. It includes formal class, generic, and method specification, and a limited form of multiple dispatch. It has been designed and implemented collaboratively by the R Consortium Object-Oriented Programming Working Group, which includes representatives from R-Core, 'Bioconductor', 'Posit'/'tidyverse', and the wider R community.", + "License": "MIT + file LICENSE", + "URL": "https://rconsortium.github.io/S7/, https://github.com/RConsortium/S7", + "BugReports": "https://github.com/RConsortium/S7/issues", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ "utils" - ] + ], + "Suggests": [ + "bench", + "callr", + "covr", + "knitr", + "methods", + "rmarkdown", + "testthat (>= 3.2.0)", + "tibble" + ], + "VignetteBuilder": "knitr", + "Config/build/compilation-database": "true", + "Config/Needs/website": "sloop", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "TRUE", + "Config/testthat/start-first": "external-generic", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Object-Oriented Programming Working Group [cph], Davis Vaughan [aut], Jim Hester [aut] (ORCID: ), Tomasz Kalinowski [aut], Will Landau [aut], Michael Lawrence [aut], Martin Maechler [aut] (ORCID: ), Luke Tierney [aut], Hadley Wickham [aut, cre] (ORCID: )", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "SparseM": { "Package": "SparseM", @@ -311,6 +470,28 @@ "sys" ] }, + "assertthat": { + "Package": "assertthat", + "Version": "0.2.1", + "Source": "Repository", + "Title": "Easy Pre and Post Assertions", + "Authors@R": "person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", c(\"aut\", \"cre\"))", + "Description": "An extension to stopifnot() that makes it easy to declare the pre and post conditions that you code should satisfy, while also producing friendly error messages so that your users know what's gone wrong.", + "License": "GPL-3", + "Imports": [ + "tools" + ], + "Suggests": [ + "testthat", + "covr" + ], + "RoxygenNote": "6.0.1", + "Collate": "'assert-that.r' 'on-failure.r' 'assertions-file.r' 'assertions-scalar.R' 'assertions.r' 'base.r' 'base-comparison.r' 'base-is.r' 'base-logical.r' 'base-misc.r' 'utils.r' 'validate-that.R'", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" + }, "backports": { "Package": "backports", "Version": "1.5.0", @@ -327,6 +508,70 @@ "R" ] }, + "bbmle": { + "Package": "bbmle", + "Version": "1.0.25.1", + "Source": "Repository", + "Title": "Tools for General Maximum Likelihood Estimation", + "Description": "Methods and functions for fitting maximum likelihood models in R. This package modifies and extends the 'mle' classes in the 'stats4' package.", + "Authors@R": "c(person(\"Ben\",\"Bolker\",email=\"bolker@mcmaster.ca\",role=c(\"aut\",\"cre\"), comment=c(ORCID=\"0000-0002-2127-0443\")), person(\"R Development Core Team\",role=c(\"aut\")), person(\"Iago Giné-Vázquez\", role=c(\"ctb\")) )", + "Depends": [ + "R (>= 3.0.0)", + "stats4" + ], + "Imports": [ + "stats", + "numDeriv", + "lattice", + "MASS", + "methods", + "bdsmatrix", + "Matrix", + "mvtnorm" + ], + "Suggests": [ + "emdbook", + "rms", + "ggplot2", + "RUnit", + "MuMIn", + "AICcmodavg", + "Hmisc", + "optimx (>= 2013.8.6)", + "knitr", + "testthat" + ], + "VignetteBuilder": "knitr", + "BuildVignettes": "yes", + "License": "GPL", + "URL": "https://github.com/bbolker/bbmle", + "Collate": "'mle2-class.R' 'mle2-methods.R' 'mle.R' 'confint.R' 'predict.R' 'profile.R' 'update.R' 'dists.R' 'IC.R' 'slice.R' 'impsamp.R' 'TMB.R'", + "RoxygenNote": "7.1.0", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Ben Bolker [aut, cre] (), R Development Core Team [aut], Iago Giné-Vázquez [ctb]", + "Maintainer": "Ben Bolker ", + "Repository": "CRAN" + }, + "bdsmatrix": { + "Package": "bdsmatrix", + "Version": "1.3-7", + "Source": "Repository", + "Title": "Routines for Block Diagonal Symmetric Matrices", + "Maintainer": "Terry Therneau ", + "Date": "2024-03-01", + "Depends": [ + "methods", + "R (>= 2.0.0)" + ], + "LazyLoad": "Yes", + "Author": "Terry Therneau", + "Description": "This is a special case of sparse matrices, used by coxme.", + "License": "LGPL-2", + "Collate": "bdsmatrix.R gchol.R gchol.bdsmatrix.R as.matrix.bdsmatrix.R bdsBlock.R bdsI.R bdsmatrix.ibd.R bdsmatrix.reconcile.R diag.bdsmatrix.R listbdsmatrix.R multiply.bdsmatrix.R solve.bdsmatrix.R solve.gchol.R solve.gchol.bdsmatrix.R backsolve.R", + "NeedsCompilation": "yes", + "Repository": "CRAN" + }, "beeswarm": { "Package": "beeswarm", "Version": "0.4.0", @@ -452,10 +697,48 @@ "Package": "cli", "Version": "3.6.5", "Source": "Repository", - "Requirements": [ - "R", + "Title": "Helpers for Developing Command Line Interfaces", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"gabor@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Kirill\", \"Müller\", role = \"ctb\"), person(\"Salim\", \"Brüggemann\", , \"salim-b@pm.me\", role = \"ctb\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A suite of tools to build attractive command line interfaces ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via a 'CSS'-like language. It also contains a number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI colors and text styles as well.", + "License": "MIT + file LICENSE", + "URL": "https://cli.r-lib.org, https://github.com/r-lib/cli", + "BugReports": "https://github.com/r-lib/cli/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ "utils" - ] + ], + "Suggests": [ + "callr", + "covr", + "crayon", + "digest", + "glue (>= 1.6.0)", + "grDevices", + "htmltools", + "htmlwidgets", + "knitr", + "methods", + "processx", + "ps (>= 1.3.4.9000)", + "rlang (>= 1.0.2.9003)", + "rmarkdown", + "rprojroot", + "rstudioapi", + "testthat (>= 3.2.0)", + "tibble", + "whoami", + "withr" + ], + "Config/Needs/website": "r-lib/asciicast, bench, brio, cpp11, decor, desc, fansi, prettyunits, sessioninfo, tidyverse/tidytemplate, usethis, vctrs", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Gábor Csárdi [aut, cre], Hadley Wickham [ctb], Kirill Müller [ctb], Salim Brüggemann [ctb] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "CRAN" }, "cluster": { "Package": "cluster", @@ -566,9 +849,48 @@ "Package": "cpp11", "Version": "0.5.2", "Source": "Repository", - "Requirements": [ - "R" - ] + "Title": "A C++11 Interface for R's C Interface", + "Authors@R": "c( person(\"Davis\", \"Vaughan\", email = \"davis@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4777-038X\")), person(\"Jim\",\"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Romain\", \"François\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Benjamin\", \"Kietzman\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Provides a header only, C++11 interface to R's C interface. Compared to other approaches 'cpp11' strives to be safe against long jumps from the C API as well as C++ exceptions, conform to normal R function semantics and supports interaction with 'ALTREP' vectors.", + "License": "MIT + file LICENSE", + "URL": "https://cpp11.r-lib.org, https://github.com/r-lib/cpp11", + "BugReports": "https://github.com/r-lib/cpp11/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Suggests": [ + "bench", + "brio", + "callr", + "cli", + "covr", + "decor", + "desc", + "ggplot2", + "glue", + "knitr", + "lobstr", + "mockery", + "progress", + "rmarkdown", + "scales", + "Rcpp", + "testthat (>= 3.2.0)", + "tibble", + "utils", + "vctrs", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/Needs/cpp11/cpp_register": "brio, cli, decor, desc, glue, tibble, vctrs", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Davis Vaughan [aut, cre] (), Jim Hester [aut] (), Romain François [aut] (), Benjamin Kietzman [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "CRAN" }, "crosstalk": { "Package": "crosstalk", @@ -606,22 +928,63 @@ "Package": "data.table", "Version": "1.18.0", "Source": "Repository", - "Requirements": [ - "methods", - "R" - ] + "Title": "Extension of `data.frame`", + "Depends": [ + "R (>= 3.4.0)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "bit64 (>= 4.0.0)", + "bit (>= 4.0.4)", + "R.utils (>= 2.13.0)", + "xts", + "zoo (>= 1.8-1)", + "yaml", + "knitr", + "markdown" + ], + "Description": "Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development.", + "License": "MPL-2.0 | file LICENSE", + "URL": "https://r-datatable.com, https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table", + "BugReports": "https://github.com/Rdatatable/data.table/issues", + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "ByteCompile": "TRUE", + "Authors@R": "c( person(\"Tyson\",\"Barrett\", role=c(\"aut\",\"cre\"), email=\"t.barrett88@gmail.com\", comment = c(ORCID=\"0000-0002-2137-1391\")), person(\"Matt\",\"Dowle\", role=\"aut\", email=\"mattjdowle@gmail.com\"), person(\"Arun\",\"Srinivasan\", role=\"aut\", email=\"asrini@pm.me\"), person(\"Jan\",\"Gorecki\", role=\"aut\", email=\"j.gorecki@wit.edu.pl\"), person(\"Michael\",\"Chirico\", role=\"aut\", email=\"michaelchirico4@gmail.com\", comment = c(ORCID=\"0000-0003-0787-087X\")), person(\"Toby\",\"Hocking\", role=\"aut\", email=\"toby.hocking@r-project.org\", comment = c(ORCID=\"0000-0002-3146-0865\")), person(\"Benjamin\",\"Schwendinger\",role=\"aut\", comment = c(ORCID=\"0000-0003-3315-8114\")), person(\"Ivan\", \"Krylov\", role=\"aut\", email=\"ikrylov@disroot.org\", comment = c(ORCID=\"0000-0002-0172-3812\")), person(\"Pasha\",\"Stetsenko\", role=\"ctb\"), person(\"Tom\",\"Short\", role=\"ctb\"), person(\"Steve\",\"Lianoglou\", role=\"ctb\"), person(\"Eduard\",\"Antonyan\", role=\"ctb\"), person(\"Markus\",\"Bonsch\", role=\"ctb\"), person(\"Hugh\",\"Parsonage\", role=\"ctb\"), person(\"Scott\",\"Ritchie\", role=\"ctb\"), person(\"Kun\",\"Ren\", role=\"ctb\"), person(\"Xianying\",\"Tan\", role=\"ctb\"), person(\"Rick\",\"Saporta\", role=\"ctb\"), person(\"Otto\",\"Seiskari\", role=\"ctb\"), person(\"Xianghui\",\"Dong\", role=\"ctb\"), person(\"Michel\",\"Lang\", role=\"ctb\"), person(\"Watal\",\"Iwasaki\", role=\"ctb\"), person(\"Seth\",\"Wenchel\", role=\"ctb\"), person(\"Karl\",\"Broman\", role=\"ctb\"), person(\"Tobias\",\"Schmidt\", role=\"ctb\"), person(\"David\",\"Arenburg\", role=\"ctb\"), person(\"Ethan\",\"Smith\", role=\"ctb\"), person(\"Francois\",\"Cocquemas\", role=\"ctb\"), person(\"Matthieu\",\"Gomez\", role=\"ctb\"), person(\"Philippe\",\"Chataignon\", role=\"ctb\"), person(\"Nello\",\"Blaser\", role=\"ctb\"), person(\"Dmitry\",\"Selivanov\", role=\"ctb\"), person(\"Andrey\",\"Riabushenko\", role=\"ctb\"), person(\"Cheng\",\"Lee\", role=\"ctb\"), person(\"Declan\",\"Groves\", role=\"ctb\"), person(\"Daniel\",\"Possenriede\", role=\"ctb\"), person(\"Felipe\",\"Parages\", role=\"ctb\"), person(\"Denes\",\"Toth\", role=\"ctb\"), person(\"Mus\",\"Yaramaz-David\", role=\"ctb\"), person(\"Ayappan\",\"Perumal\", role=\"ctb\"), person(\"James\",\"Sams\", role=\"ctb\"), person(\"Martin\",\"Morgan\", role=\"ctb\"), person(\"Michael\",\"Quinn\", role=\"ctb\"), person(given=\"@javrucebo\", role=\"ctb\", comment=\"GitHub user\"), person(\"Marc\",\"Halperin\", role=\"ctb\"), person(\"Roy\",\"Storey\", role=\"ctb\"), person(\"Manish\",\"Saraswat\", role=\"ctb\"), person(\"Morgan\",\"Jacob\", role=\"ctb\"), person(\"Michael\",\"Schubmehl\", role=\"ctb\"), person(\"Davis\",\"Vaughan\", role=\"ctb\"), person(\"Leonardo\",\"Silvestri\", role=\"ctb\"), person(\"Jim\",\"Hester\", role=\"ctb\"), person(\"Anthony\",\"Damico\", role=\"ctb\"), person(\"Sebastian\",\"Freundt\", role=\"ctb\"), person(\"David\",\"Simons\", role=\"ctb\"), person(\"Elliott\",\"Sales de Andrade\", role=\"ctb\"), person(\"Cole\",\"Miller\", role=\"ctb\"), person(\"Jens Peder\",\"Meldgaard\", role=\"ctb\"), person(\"Vaclav\",\"Tlapak\", role=\"ctb\"), person(\"Kevin\",\"Ushey\", role=\"ctb\"), person(\"Dirk\",\"Eddelbuettel\", role=\"ctb\"), person(\"Tony\",\"Fischetti\", role=\"ctb\"), person(\"Ofek\",\"Shilon\", role=\"ctb\"), person(\"Vadim\",\"Khotilovich\", role=\"ctb\"), person(\"Hadley\",\"Wickham\", role=\"ctb\"), person(\"Bennet\",\"Becker\", role=\"ctb\"), person(\"Kyle\",\"Haynes\", role=\"ctb\"), person(\"Boniface Christian\",\"Kamgang\", role=\"ctb\"), person(\"Olivier\",\"Delmarcell\", role=\"ctb\"), person(\"Josh\",\"O'Brien\", role=\"ctb\"), person(\"Dereck\",\"de Mezquita\", role=\"ctb\"), person(\"Michael\",\"Czekanski\", role=\"ctb\"), person(\"Dmitry\", \"Shemetov\", role=\"ctb\"), person(\"Nitish\", \"Jha\", role=\"ctb\"), person(\"Joshua\", \"Wu\", role=\"ctb\"), person(\"Iago\", \"Giné-Vázquez\", role=\"ctb\"), person(\"Anirban\", \"Chetia\", role=\"ctb\"), person(\"Doris\", \"Amoakohene\", role=\"ctb\"), person(\"Angel\", \"Feliz\", role=\"ctb\"), person(\"Michael\",\"Young\", role=\"ctb\"), person(\"Mark\", \"Seeto\", role=\"ctb\"), person(\"Philippe\", \"Grosjean\", role=\"ctb\"), person(\"Vincent\", \"Runge\", role=\"ctb\"), person(\"Christian\", \"Wia\", role=\"ctb\"), person(\"Elise\", \"Maigné\", role=\"ctb\"), person(\"Vincent\", \"Rocher\", role=\"ctb\"), person(\"Vijay\", \"Lulla\", role=\"ctb\"), person(\"Aljaž\", \"Sluga\", role=\"ctb\"), person(\"Bill\", \"Evans\", role=\"ctb\"), person(\"Reino\", \"Bruner\", role=\"ctb\"), person(given=\"@badasahog\", role=\"ctb\", comment=\"GitHub user\"), person(\"Vinit\", \"Thakur\", role=\"ctb\"), person(\"Mukul\", \"Kumar\", role=\"ctb\"), person(\"Ildikó\", \"Czeller\", role=\"ctb\") )", + "NeedsCompilation": "yes", + "Author": "Tyson Barrett [aut, cre] (ORCID: ), Matt Dowle [aut], Arun Srinivasan [aut], Jan Gorecki [aut], Michael Chirico [aut] (ORCID: ), Toby Hocking [aut] (ORCID: ), Benjamin Schwendinger [aut] (ORCID: ), Ivan Krylov [aut] (ORCID: ), Pasha Stetsenko [ctb], Tom Short [ctb], Steve Lianoglou [ctb], Eduard Antonyan [ctb], Markus Bonsch [ctb], Hugh Parsonage [ctb], Scott Ritchie [ctb], Kun Ren [ctb], Xianying Tan [ctb], Rick Saporta [ctb], Otto Seiskari [ctb], Xianghui Dong [ctb], Michel Lang [ctb], Watal Iwasaki [ctb], Seth Wenchel [ctb], Karl Broman [ctb], Tobias Schmidt [ctb], David Arenburg [ctb], Ethan Smith [ctb], Francois Cocquemas [ctb], Matthieu Gomez [ctb], Philippe Chataignon [ctb], Nello Blaser [ctb], Dmitry Selivanov [ctb], Andrey Riabushenko [ctb], Cheng Lee [ctb], Declan Groves [ctb], Daniel Possenriede [ctb], Felipe Parages [ctb], Denes Toth [ctb], Mus Yaramaz-David [ctb], Ayappan Perumal [ctb], James Sams [ctb], Martin Morgan [ctb], Michael Quinn [ctb], @javrucebo [ctb] (GitHub user), Marc Halperin [ctb], Roy Storey [ctb], Manish Saraswat [ctb], Morgan Jacob [ctb], Michael Schubmehl [ctb], Davis Vaughan [ctb], Leonardo Silvestri [ctb], Jim Hester [ctb], Anthony Damico [ctb], Sebastian Freundt [ctb], David Simons [ctb], Elliott Sales de Andrade [ctb], Cole Miller [ctb], Jens Peder Meldgaard [ctb], Vaclav Tlapak [ctb], Kevin Ushey [ctb], Dirk Eddelbuettel [ctb], Tony Fischetti [ctb], Ofek Shilon [ctb], Vadim Khotilovich [ctb], Hadley Wickham [ctb], Bennet Becker [ctb], Kyle Haynes [ctb], Boniface Christian Kamgang [ctb], Olivier Delmarcell [ctb], Josh O'Brien [ctb], Dereck de Mezquita [ctb], Michael Czekanski [ctb], Dmitry Shemetov [ctb], Nitish Jha [ctb], Joshua Wu [ctb], Iago Giné-Vázquez [ctb], Anirban Chetia [ctb], Doris Amoakohene [ctb], Angel Feliz [ctb], Michael Young [ctb], Mark Seeto [ctb], Philippe Grosjean [ctb], Vincent Runge [ctb], Christian Wia [ctb], Elise Maigné [ctb], Vincent Rocher [ctb], Vijay Lulla [ctb], Aljaž Sluga [ctb], Bill Evans [ctb], Reino Bruner [ctb], @badasahog [ctb] (GitHub user), Vinit Thakur [ctb], Mukul Kumar [ctb], Ildikó Czeller [ctb]", + "Maintainer": "Tyson Barrett ", + "Repository": "CRAN" }, "deSolve": { "Package": "deSolve", "Version": "1.40", "Source": "Repository", - "Requirements": [ + "Title": "Solvers for Initial Value Problems of Differential Equations ('ODE', 'DAE', 'DDE')", + "Authors@R": "c(person(\"Karline\",\"Soetaert\", role = c(\"aut\"), email = \"karline.soetaert@nioz.nl\", comment = c(ORCID = \"0000-0003-4603-7100\")), person(\"Thomas\",\"Petzoldt\", role = c(\"aut\", \"cre\"), email = \"thomas.petzoldt@tu-dresden.de\", comment = c(ORCID = \"0000-0002-4951-6468\")), person(\"R. Woodrow\",\"Setzer\", role = c(\"aut\"), email = \"setzer.woodrow@epa.gov\", comment = c(ORCID = \"0000-0002-6709-9186\")), person(\"Peter N.\",\"Brown\", role = \"ctb\", comment = \"files ddaspk.f, dvode.f, zvode.f\"), person(\"George D.\",\"Byrne\", role = \"ctb\", comment = \"files dvode.f, zvode.f\"), person(\"Ernst\",\"Hairer\", role = \"ctb\", comment = \"files radau5.f, radau5a\"), person(\"Alan C.\",\"Hindmarsh\", role = \"ctb\", comment = \"files ddaspk.f, dlsode.f, dvode.f, zvode.f, opdkmain.f, opdka1.f\"), person(\"Cleve\",\"Moler\", role = \"ctb\", comment = \"file dlinpck.f\"), person(\"Linda R.\",\"Petzold\", role = \"ctb\", comment = \"files ddaspk.f, dlsoda.f\"), person(\"Youcef\", \"Saad\", role = \"ctb\", comment = \"file dsparsk.f\"), person(\"Clement W.\",\"Ulrich\", role = \"ctb\", comment = \"file ddaspk.f\") )", + "Author": "Karline Soetaert [aut] (), Thomas Petzoldt [aut, cre] (), R. Woodrow Setzer [aut] (), Peter N. Brown [ctb] (files ddaspk.f, dvode.f, zvode.f), George D. Byrne [ctb] (files dvode.f, zvode.f), Ernst Hairer [ctb] (files radau5.f, radau5a), Alan C. Hindmarsh [ctb] (files ddaspk.f, dlsode.f, dvode.f, zvode.f, opdkmain.f, opdka1.f), Cleve Moler [ctb] (file dlinpck.f), Linda R. Petzold [ctb] (files ddaspk.f, dlsoda.f), Youcef Saad [ctb] (file dsparsk.f), Clement W. Ulrich [ctb] (file ddaspk.f)", + "Maintainer": "Thomas Petzoldt ", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "methods", "graphics", "grDevices", - "methods", - "R", "stats" - ] + ], + "Suggests": [ + "scatterplot3d", + "FME" + ], + "Description": "Functions that solve initial value problems of a system of first-order ordinary differential equations ('ODE'), of partial differential equations ('PDE'), of differential algebraic equations ('DAE'), and of delay differential equations. The functions provide an interface to the FORTRAN functions 'lsoda', 'lsodar', 'lsode', 'lsodes' of the 'ODEPACK' collection, to the FORTRAN functions 'dvode', 'zvode' and 'daspk' and a C-implementation of solvers of the 'Runge-Kutta' family with fixed or variable time steps. The package contains routines designed for solving 'ODEs' resulting from 1-D, 2-D and 3-D partial differential equations ('PDE') that have been converted to 'ODEs' by numerical differencing.", + "License": "GPL (>= 2)", + "URL": "http://desolve.r-forge.r-project.org/", + "LazyData": "yes", + "NeedsCompilation": "yes", + "Repository": "CRAN" }, "desc": { "Package": "desc", @@ -681,22 +1044,64 @@ "Package": "dplyr", "Version": "1.1.4", "Source": "Repository", - "Requirements": [ - "cli", + "Type": "Package", + "Title": "A Grammar of Data Manipulation", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Romain\", \"François\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Lionel\", \"Henry\", role = \"aut\"), person(\"Kirill\", \"Müller\", role = \"aut\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4777-038X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A fast, consistent tool for working with data frame like objects, both in memory and out of memory.", + "License": "MIT + file LICENSE", + "URL": "https://dplyr.tidyverse.org, https://github.com/tidyverse/dplyr", + "BugReports": "https://github.com/tidyverse/dplyr/issues", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "cli (>= 3.4.0)", "generics", - "glue", - "lifecycle", - "magrittr", + "glue (>= 1.3.2)", + "lifecycle (>= 1.0.3)", + "magrittr (>= 1.5)", "methods", - "pillar", - "R", + "pillar (>= 1.9.0)", "R6", - "rlang", - "tibble", - "tidyselect", + "rlang (>= 1.1.0)", + "tibble (>= 3.2.0)", + "tidyselect (>= 1.2.0)", "utils", - "vctrs" - ] + "vctrs (>= 0.6.4)" + ], + "Suggests": [ + "bench", + "broom", + "callr", + "covr", + "DBI", + "dbplyr (>= 2.2.1)", + "ggplot2", + "knitr", + "Lahman", + "lobstr", + "microbenchmark", + "nycflights13", + "purrr", + "rmarkdown", + "RMySQL", + "RPostgreSQL", + "RSQLite", + "stringi (>= 1.7.6)", + "testthat (>= 3.1.5)", + "tidyr (>= 1.3.0)", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse, shiny, pkgdown, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre] (), Romain François [aut] (), Lionel Henry [aut], Kirill Müller [aut] (), Davis Vaughan [aut] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "elliptic": { "Package": "elliptic", @@ -728,7 +1133,46 @@ "Package": "farver", "Version": "2.1.2", "Source": "Repository", - "Requirements": [] + "Type": "Package", + "Title": "High Performance Colour Space Manipulation", + "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Berendea\", \"Nicolae\", role = \"aut\", comment = \"Author of the ColorSpace C++ library\"), person(\"Romain\", \"François\", , \"romain@purrple.cat\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "The encoding of colour can be handled in many different ways, using different colour spaces. As different colour spaces have different uses, efficient conversion between these representations are important. The 'farver' package provides a set of functions that gives access to very fast colour space conversion and comparisons implemented in C++, and offers speed improvements over the 'convertColor' function in the 'grDevices' package.", + "License": "MIT + file LICENSE", + "URL": "https://farver.data-imaginist.com, https://github.com/thomasp85/farver", + "BugReports": "https://github.com/thomasp85/farver/issues", + "Suggests": [ + "covr", + "testthat (>= 3.0.0)" + ], + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "NeedsCompilation": "yes", + "Author": "Thomas Lin Pedersen [cre, aut] (), Berendea Nicolae [aut] (Author of the ColorSpace C++ library), Romain François [aut] (), Posit, PBC [cph, fnd]", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "CRAN" + }, + "fastGHQuad": { + "Package": "fastGHQuad", + "Version": "1.0.1", + "Source": "Repository", + "Type": "Package", + "Title": "Fast 'Rcpp' Implementation of Gauss-Hermite Quadrature", + "Date": "2022-05-03", + "Author": "Alexander W Blocker", + "Maintainer": "Alexander W Blocker ", + "Description": "Fast, numerically-stable Gauss-Hermite quadrature rules and utility functions for adaptive GH quadrature. See Liu, Q. and Pierce, D. A. (1994) for a reference on these methods.", + "License": "MIT + file LICENSE", + "LazyLoad": "yes", + "URL": "https://github.com/awblocker/fastGHQuad", + "Depends": [ + "Rcpp (>= 0.11.0)" + ], + "LinkingTo": [ + "Rcpp" + ], + "NeedsCompilation": "yes", + "Repository": "CRAN" }, "fastmap": { "Package": "fastmap", @@ -788,6 +1232,71 @@ "RemoteRepo": "flexplot", "RemoteSha": "cae36ba45502ce1794ad35cfeaf0155275db3056" }, + "flexsurv": { + "Package": "flexsurv", + "Version": "2.3.2", + "Source": "Repository", + "Type": "Package", + "Title": "Flexible Parametric Survival and Multi-State Models", + "Date": "2024-08-16", + "Authors@R": "c(person(\"Christopher\", \"Jackson\", email=\"chris.jackson@mrc-bsu.cam.ac.uk\", role=c(\"aut\", \"cre\")), person(\"Paul\", \"Metcalfe\", role=c(\"ctb\")), person(\"Jordan\", \"Amdahl\", role=c(\"ctb\")), person(\"Matthew T.\", \"Warkentin\", role = c(\"ctb\")), person(\"Michael\", \"Sweeting\", role = c(\"ctb\")), person(\"Kevin\", \"Kunzmann\", role = c(\"ctb\")) )", + "Description": "Flexible parametric models for time-to-event data, including the Royston-Parmar spline model, generalized gamma and generalized F distributions. Any user-defined parametric distribution can be fitted, given at least an R function defining the probability density or hazard. There are also tools for fitting and predicting from fully parametric multi-state models, based on either cause-specific hazards or mixture models.", + "License": "GPL (>= 2)", + "Depends": [ + "survival", + "R (>= 2.15.0)" + ], + "Imports": [ + "assertthat", + "deSolve", + "generics", + "magrittr", + "mstate (>= 0.2.10)", + "Matrix", + "muhaz", + "mvtnorm", + "numDeriv", + "quadprog", + "Rcpp (>= 0.11.5)", + "rlang", + "rstpm2", + "purrr", + "statmod", + "tibble", + "tidyr", + "dplyr", + "tidyselect", + "ggplot2" + ], + "Encoding": "UTF-8", + "Suggests": [ + "splines2", + "flexsurvcure", + "survminer", + "lubridate", + "rmarkdown", + "colorspace", + "eha", + "knitr", + "msm", + "testthat", + "TH.data", + "broom", + "covr" + ], + "URL": "https://github.com/chjackson/flexsurv, http://chjackson.github.io/flexsurv/", + "BugReports": "https://github.com/chjackson/flexsurv/issues", + "VignetteBuilder": "knitr", + "LazyData": "yes", + "LinkingTo": [ + "Rcpp" + ], + "RoxygenNote": "7.3.1", + "NeedsCompilation": "yes", + "Author": "Christopher Jackson [aut, cre], Paul Metcalfe [ctb], Jordan Amdahl [ctb], Matthew T. Warkentin [ctb], Michael Sweeting [ctb], Kevin Kunzmann [ctb]", + "Maintainer": "Christopher Jackson ", + "Repository": "CRAN" + }, "fontBitstreamVera": { "Package": "fontBitstreamVera", "Version": "0.1.1", @@ -908,10 +1417,33 @@ "Package": "generics", "Version": "0.1.4", "Source": "Repository", - "Requirements": [ - "methods", - "R" - ] + "Title": "Common S3 Generics not Provided by Base R Methods Related to Model Fitting", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Max\", \"Kuhn\", , \"max@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"https://ror.org/03wc8by49\")) )", + "Description": "In order to reduce potential package dependencies and conflicts, generics provides a number of commonly used S3 generics.", + "License": "MIT + file LICENSE", + "URL": "https://generics.r-lib.org, https://github.com/r-lib/generics", + "BugReports": "https://github.com/r-lib/generics/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "covr", + "pkgload", + "testthat (>= 3.0.0)", + "tibble", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre] (ORCID: ), Max Kuhn [aut], Davis Vaughan [aut], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "ggbeeswarm": { "Package": "ggbeeswarm", @@ -930,21 +1462,74 @@ "Package": "ggplot2", "Version": "4.0.1", "Source": "Repository", - "Requirements": [ + "Title": "Create Elegant Data Visualisations Using the Grammar of Graphics", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Winston\", \"Chang\", role = \"aut\", comment = c(ORCID = \"0000-0002-1576-2126\")), person(\"Lionel\", \"Henry\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Kohske\", \"Takahashi\", role = \"aut\"), person(\"Claus\", \"Wilke\", role = \"aut\", comment = c(ORCID = \"0000-0002-7470-9261\")), person(\"Kara\", \"Woo\", role = \"aut\", comment = c(ORCID = \"0000-0002-5125-4188\")), person(\"Hiroaki\", \"Yutani\", role = \"aut\", comment = c(ORCID = \"0000-0002-3385-7233\")), person(\"Dewey\", \"Dunnington\", role = \"aut\", comment = c(ORCID = \"0000-0002-9415-4582\")), person(\"Teun\", \"van den Brand\", role = \"aut\", comment = c(ORCID = \"0000-0002-9335-7468\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "A system for 'declaratively' creating graphics, based on \"The Grammar of Graphics\". You provide the data, tell 'ggplot2' how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.", + "License": "MIT + file LICENSE", + "URL": "https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2", + "BugReports": "https://github.com/tidyverse/ggplot2/issues", + "Depends": [ + "R (>= 4.1)" + ], + "Imports": [ "cli", "grDevices", "grid", - "gtable", + "gtable (>= 0.3.6)", "isoband", - "lifecycle", - "R", - "rlang", + "lifecycle (> 1.0.1)", + "rlang (>= 1.1.0)", "S7", - "scales", + "scales (>= 1.4.0)", "stats", - "vctrs", - "withr" - ] + "vctrs (>= 0.6.0)", + "withr (>= 2.5.0)" + ], + "Suggests": [ + "broom", + "covr", + "dplyr", + "ggplot2movies", + "hexbin", + "Hmisc", + "hms", + "knitr", + "mapproj", + "maps", + "MASS", + "mgcv", + "multcomp", + "munsell", + "nlme", + "profvis", + "quantreg", + "quarto", + "ragg (>= 1.2.6)", + "RColorBrewer", + "roxygen2", + "rpart", + "sf (>= 0.7-3)", + "svglite (>= 2.1.2)", + "testthat (>= 3.1.5)", + "tibble", + "vdiffr (>= 1.0.6)", + "xml2" + ], + "Enhances": [ + "sp" + ], + "VignetteBuilder": "quarto", + "Config/Needs/website": "ggtext, tidyr, forcats, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-04-23", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.3", + "Collate": "'ggproto.R' 'ggplot-global.R' 'aaa-.R' 'aes-colour-fill-alpha.R' 'aes-evaluation.R' 'aes-group-order.R' 'aes-linetype-size-shape.R' 'aes-position.R' 'all-classes.R' 'compat-plyr.R' 'utilities.R' 'aes.R' 'annotation-borders.R' 'utilities-checks.R' 'legend-draw.R' 'geom-.R' 'annotation-custom.R' 'annotation-logticks.R' 'scale-type.R' 'layer.R' 'make-constructor.R' 'geom-polygon.R' 'geom-map.R' 'annotation-map.R' 'geom-raster.R' 'annotation-raster.R' 'annotation.R' 'autolayer.R' 'autoplot.R' 'axis-secondary.R' 'backports.R' 'bench.R' 'bin.R' 'coord-.R' 'coord-cartesian-.R' 'coord-fixed.R' 'coord-flip.R' 'coord-map.R' 'coord-munch.R' 'coord-polar.R' 'coord-quickmap.R' 'coord-radial.R' 'coord-sf.R' 'coord-transform.R' 'data.R' 'docs_layer.R' 'facet-.R' 'facet-grid-.R' 'facet-null.R' 'facet-wrap.R' 'fortify-map.R' 'fortify-models.R' 'fortify-spatial.R' 'fortify.R' 'stat-.R' 'geom-abline.R' 'geom-rect.R' 'geom-bar.R' 'geom-tile.R' 'geom-bin2d.R' 'geom-blank.R' 'geom-boxplot.R' 'geom-col.R' 'geom-path.R' 'geom-contour.R' 'geom-point.R' 'geom-count.R' 'geom-crossbar.R' 'geom-segment.R' 'geom-curve.R' 'geom-defaults.R' 'geom-ribbon.R' 'geom-density.R' 'geom-density2d.R' 'geom-dotplot.R' 'geom-errorbar.R' 'geom-freqpoly.R' 'geom-function.R' 'geom-hex.R' 'geom-histogram.R' 'geom-hline.R' 'geom-jitter.R' 'geom-label.R' 'geom-linerange.R' 'geom-pointrange.R' 'geom-quantile.R' 'geom-rug.R' 'geom-sf.R' 'geom-smooth.R' 'geom-spoke.R' 'geom-text.R' 'geom-violin.R' 'geom-vline.R' 'ggplot2-package.R' 'grob-absolute.R' 'grob-dotstack.R' 'grob-null.R' 'grouping.R' 'properties.R' 'margins.R' 'theme-elements.R' 'guide-.R' 'guide-axis.R' 'guide-axis-logticks.R' 'guide-axis-stack.R' 'guide-axis-theta.R' 'guide-legend.R' 'guide-bins.R' 'guide-colorbar.R' 'guide-colorsteps.R' 'guide-custom.R' 'guide-none.R' 'guide-old.R' 'guides-.R' 'guides-grid.R' 'hexbin.R' 'import-standalone-obj-type.R' 'import-standalone-types-check.R' 'labeller.R' 'labels.R' 'layer-sf.R' 'layout.R' 'limits.R' 'performance.R' 'plot-build.R' 'plot-construction.R' 'plot-last.R' 'plot.R' 'position-.R' 'position-collide.R' 'position-dodge.R' 'position-dodge2.R' 'position-identity.R' 'position-jitter.R' 'position-jitterdodge.R' 'position-nudge.R' 'position-stack.R' 'quick-plot.R' 'reshape-add-margins.R' 'save.R' 'scale-.R' 'scale-alpha.R' 'scale-binned.R' 'scale-brewer.R' 'scale-colour.R' 'scale-continuous.R' 'scale-date.R' 'scale-discrete-.R' 'scale-expansion.R' 'scale-gradient.R' 'scale-grey.R' 'scale-hue.R' 'scale-identity.R' 'scale-linetype.R' 'scale-linewidth.R' 'scale-manual.R' 'scale-shape.R' 'scale-size.R' 'scale-steps.R' 'scale-view.R' 'scale-viridis.R' 'scales-.R' 'stat-align.R' 'stat-bin.R' 'stat-summary-2d.R' 'stat-bin2d.R' 'stat-bindot.R' 'stat-binhex.R' 'stat-boxplot.R' 'stat-connect.R' 'stat-contour.R' 'stat-count.R' 'stat-density-2d.R' 'stat-density.R' 'stat-ecdf.R' 'stat-ellipse.R' 'stat-function.R' 'stat-identity.R' 'stat-manual.R' 'stat-qq-line.R' 'stat-qq.R' 'stat-quantilemethods.R' 'stat-sf-coordinates.R' 'stat-sf.R' 'stat-smooth-methods.R' 'stat-smooth.R' 'stat-sum.R' 'stat-summary-bin.R' 'stat-summary-hex.R' 'stat-summary.R' 'stat-unique.R' 'stat-ydensity.R' 'summarise-plot.R' 'summary.R' 'theme.R' 'theme-defaults.R' 'theme-current.R' 'theme-sub.R' 'utilities-break.R' 'utilities-grid.R' 'utilities-help.R' 'utilities-patterns.R' 'utilities-resolution.R' 'utilities-tidy-eval.R' 'zxx.R' 'zzz.R'", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut] (ORCID: ), Winston Chang [aut] (ORCID: ), Lionel Henry [aut], Thomas Lin Pedersen [aut, cre] (ORCID: ), Kohske Takahashi [aut], Claus Wilke [aut] (ORCID: ), Kara Woo [aut] (ORCID: ), Hiroaki Yutani [aut] (ORCID: ), Dewey Dunnington [aut] (ORCID: ), Teun van den Brand [aut] (ORCID: ), Posit, PBC [cph, fnd] (ROR: )", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "CRAN" }, "ggpp": { "Package": "ggpp", @@ -1077,10 +1662,42 @@ "Package": "glue", "Version": "1.8.0", "Source": "Repository", - "Requirements": [ - "methods", - "R" - ] + "Title": "Interpreted String Literals", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "An implementation of interpreted string literals, inspired by Python's Literal String Interpolation and Docstrings and Julia's Triple-Quoted String Literals .", + "License": "MIT + file LICENSE", + "URL": "https://glue.tidyverse.org/, https://github.com/tidyverse/glue", + "BugReports": "https://github.com/tidyverse/glue/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "crayon", + "DBI (>= 1.2.0)", + "dplyr", + "knitr", + "magrittr", + "rlang", + "rmarkdown", + "RSQLite", + "testthat (>= 3.2.0)", + "vctrs (>= 0.3.0)", + "waldo (>= 0.5.3)", + "withr" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/Needs/website": "bench, forcats, ggbeeswarm, ggplot2, R.utils, rprintf, tidyr, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut] (), Jennifer Bryan [aut, cre] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Jennifer Bryan ", + "Repository": "CRAN" }, "gmp": { "Package": "gmp", @@ -1144,15 +1761,41 @@ "Package": "gtable", "Version": "0.3.6", "Source": "Repository", - "Requirements": [ + "Title": "Arrange 'Grobs' in Tables", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools to make it easier to work with \"tables\" of 'grobs'. The 'gtable' package defines a 'gtable' grob class that specifies a grid along with a list of grobs and their placement in the grid. Further the package makes it easy to manipulate and combine 'gtable' objects so that complex compositions can be built up sequentially.", + "License": "MIT + file LICENSE", + "URL": "https://gtable.r-lib.org, https://github.com/r-lib/gtable", + "BugReports": "https://github.com/r-lib/gtable/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ "cli", "glue", "grid", "lifecycle", - "R", - "rlang", + "rlang (>= 1.1.0)", "stats" - ] + ], + "Suggests": [ + "covr", + "ggplot2", + "knitr", + "profvis", + "rmarkdown", + "testthat (>= 3.0.0)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2024-10-25", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "CRAN" }, "highr": { "Package": "highr", @@ -1264,13 +1907,43 @@ "Package": "isoband", "Version": "0.3.0", "Source": "Repository", - "Requirements": [ + "Title": "Generate Isolines and Isobands from Regularly Spaced Elevation Grids", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Claus O.\", \"Wilke\", , \"wilke@austin.utexas.edu\", role = \"aut\", comment = c(\"Original author\", ORCID = \"0000-0002-7470-9261\")), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "A fast C++ implementation to generate contour lines (isolines) and contour polygons (isobands) from regularly spaced grids containing elevation data.", + "License": "MIT + file LICENSE", + "URL": "https://isoband.r-lib.org, https://github.com/r-lib/isoband", + "BugReports": "https://github.com/r-lib/isoband/issues", + "Imports": [ "cli", - "cpp11", "grid", "rlang", "utils" - ] + ], + "Suggests": [ + "covr", + "ggplot2", + "knitr", + "magick", + "bench", + "rmarkdown", + "sf", + "testthat (>= 3.0.0)", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-12-05", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "Config/build/compilation-database": "true", + "LinkingTo": [ + "cpp11" + ], + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut] (ORCID: ), Claus O. Wilke [aut] (Original author, ORCID: ), Thomas Lin Pedersen [aut, cre] (ORCID: ), Posit, PBC [cph, fnd] (ROR: )", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "CRAN" }, "jaspBase": { "Package": "jaspBase", @@ -1417,10 +2090,20 @@ "Package": "labeling", "Version": "0.4.3", "Source": "Repository", - "Requirements": [ - "graphics", - "stats" - ] + "Type": "Package", + "Title": "Axis Labeling", + "Date": "2023-08-29", + "Author": "Justin Talbot,", + "Maintainer": "Nuno Sempere ", + "Description": "Functions which provide a range of axis labeling algorithms.", + "License": "MIT + file LICENSE | Unlimited", + "Collate": "'labeling.R'", + "NeedsCompilation": "no", + "Imports": [ + "stats", + "graphics" + ], + "Repository": "CRAN" }, "later": { "Package": "later", @@ -1436,14 +2119,40 @@ "Package": "lattice", "Version": "0.22-7", "Source": "Repository", - "Requirements": [ + "Date": "2025-03-31", + "Priority": "recommended", + "Title": "Trellis Graphics for R", + "Authors@R": "c(person(\"Deepayan\", \"Sarkar\", role = c(\"aut\", \"cre\"), email = \"deepayan.sarkar@r-project.org\", comment = c(ORCID = \"0000-0003-4107-1553\")), person(\"Felix\", \"Andrews\", role = \"ctb\"), person(\"Kevin\", \"Wright\", role = \"ctb\", comment = \"documentation\"), person(\"Neil\", \"Klepeis\", role = \"ctb\"), person(\"Johan\", \"Larsson\", role = \"ctb\", comment = \"miscellaneous improvements\"), person(\"Zhijian (Jason)\", \"Wen\", role = \"cph\", comment = \"filled contour code\"), person(\"Paul\", \"Murrell\", role = \"ctb\", email = \"paul@stat.auckland.ac.nz\"), person(\"Stefan\", \"Eng\", role = \"ctb\", comment = \"violin plot improvements\"), person(\"Achim\", \"Zeileis\", role = \"ctb\", comment = \"modern colors\"), person(\"Alexandre\", \"Courtiol\", role = \"ctb\", comment = \"generics for larrows, lpolygon, lrect and lsegments\") )", + "Description": "A powerful and elegant high-level data visualization system inspired by Trellis graphics, with an emphasis on multivariate data. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. See ?Lattice for an introduction.", + "Depends": [ + "R (>= 4.0.0)" + ], + "Suggests": [ + "KernSmooth", + "MASS", + "latticeExtra", + "colorspace" + ], + "Imports": [ "grid", "grDevices", "graphics", "stats", - "utils", - "R" - ] + "utils" + ], + "Enhances": [ + "chron", + "zoo" + ], + "LazyLoad": "yes", + "LazyData": "yes", + "License": "GPL (>= 2)", + "URL": "https://lattice.r-forge.r-project.org/", + "BugReports": "https://github.com/deepayan/lattice/issues", + "NeedsCompilation": "yes", + "Author": "Deepayan Sarkar [aut, cre] (), Felix Andrews [ctb], Kevin Wright [ctb] (documentation), Neil Klepeis [ctb], Johan Larsson [ctb] (miscellaneous improvements), Zhijian (Jason) Wen [cph] (filled contour code), Paul Murrell [ctb], Stefan Eng [ctb] (violin plot improvements), Achim Zeileis [ctb] (modern colors), Alexandre Courtiol [ctb] (generics for larrows, lpolygon, lrect and lsegments)", + "Maintainer": "Deepayan Sarkar ", + "Repository": "CRAN" }, "lazyeval": { "Package": "lazyeval", @@ -1467,11 +2176,41 @@ "Package": "lifecycle", "Version": "1.0.5", "Source": "Repository", - "Requirements": [ - "cli", - "R", - "rlang" - ] + "Title": "Manage the Life Cycle of your Package Functions", + "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Manage the life cycle of your exported functions with shared conventions, documentation badges, and user-friendly deprecation warnings.", + "License": "MIT + file LICENSE", + "URL": "https://lifecycle.r-lib.org/, https://github.com/r-lib/lifecycle", + "BugReports": "https://github.com/r-lib/lifecycle/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "covr", + "knitr", + "lintr (>= 3.1.0)", + "rmarkdown", + "testthat (>= 3.0.1)", + "tibble", + "tidyverse", + "tools", + "vctrs", + "withr", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate, usethis", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "no", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut] (ORCID: ), Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" }, "litedown": { "Package": "litedown", @@ -1537,6 +2276,36 @@ "Source": "Repository", "Requirements": [] }, + "lsoda": { + "Package": "lsoda", + "Version": "1.2", + "Source": "Repository", + "Type": "Package", + "Title": "'C++' Header Library for Ordinary Differential Equations", + "Authors@R": "c(person(\"Mark\", \"Clements\", role = c(\"aut\", \"cre\"), email = \"mark.clements@ki.se\"), person(\"Dilawar\", \"Singh\", role=\"ctb\"), person(\"Heng\", \"Li\", role=\"ctb\"), person(\"Peter N.\",\"Brown\", role = \"ctb\"), person(\"George D.\",\"Byrne\", role = \"ctb\"), person(\"Alan C.\",\"Hindmarsh\", role = \"ctb\"), person(\"Cleve\",\"Moler\", role = \"ctb\"), person(\"Linda R.\",\"Petzold\", role = \"ctb\"))", + "Description": "A 'C++' header library for using the 'libsoda-cxx' library with R. The 'C++' header reimplements the 'lsoda' function from the 'ODEPACK' library for solving initial value problems for first order ordinary differential equations (Hindmarsh, 1982; ). The 'C++' header can be used by other R packages by linking against this package. The 'C++' functions can be called inline using 'Rcpp'. Finally, the package provides an 'ode' function to call from R.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/mclements/lsoda", + "BugReports": "https://github.com/mclements/lsoda/issues", + "Imports": [ + "Rcpp (>= 1.0.12)" + ], + "Suggests": [ + "deSolve", + "RcppArmadillo", + "RcppEigen", + "microbenchmark" + ], + "LinkingTo": [ + "Rcpp" + ], + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Mark Clements [aut, cre], Dilawar Singh [ctb], Heng Li [ctb], Peter N. Brown [ctb], George D. Byrne [ctb], Alan C. Hindmarsh [ctb], Cleve Moler [ctb], Linda R. Petzold [ctb]", + "Maintainer": "Mark Clements ", + "Repository": "CRAN" + }, "lubridate": { "Package": "lubridate", "Version": "1.9.4", @@ -1552,9 +2321,32 @@ "Package": "magrittr", "Version": "2.0.4", "Source": "Repository", - "Requirements": [ - "R" - ] + "Type": "Package", + "Title": "A Forward-Pipe Operator for R", + "Authors@R": "c( person(\"Stefan Milton\", \"Bache\", , \"stefan@stefanbache.dk\", role = c(\"aut\", \"cph\"), comment = \"Original author and creator of magrittr\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"cre\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. There is flexible support for the type of right-hand side expressions. For more information, see package vignette. To quote Rene Magritte, \"Ceci n'est pas un pipe.\"", + "License": "MIT + file LICENSE", + "URL": "https://magrittr.tidyverse.org, https://github.com/tidyverse/magrittr", + "BugReports": "https://github.com/tidyverse/magrittr/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Suggests": [ + "covr", + "knitr", + "rlang", + "rmarkdown", + "testthat" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "Yes", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Stefan Milton Bache [aut, cph] (Original author and creator of magrittr), Hadley Wickham [aut], Lionel Henry [cre], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" }, "markdown": { "Package": "markdown", @@ -1588,16 +2380,34 @@ "Package": "mgcv", "Version": "1.9-4", "Source": "Repository", - "Requirements": [ + "Authors@R": "person(given = \"Simon\", family = \"Wood\", role = c(\"aut\", \"cre\"), email = \"simon.wood@r-project.org\")", + "Title": "Mixed GAM Computation Vehicle with Automatic Smoothness Estimation", + "Description": "Generalized additive (mixed) models, some of their extensions and other generalized ridge regression with multiple smoothing parameter estimation by (Restricted) Marginal Likelihood, Cross Validation and similar, or using iterated nested Laplace approximation for fully Bayesian inference. See Wood (2025) for an overview. Includes a gam() function, a wide variety of smoothers, 'JAGS' support and distributions beyond the exponential family.", + "Priority": "recommended", + "Depends": [ + "R (>= 4.4.0)", + "nlme (>= 3.1-64)" + ], + "Imports": [ + "methods", + "stats", "graphics", "Matrix", - "methods", - "nlme", - "R", "splines", - "stats", "utils" - ] + ], + "Suggests": [ + "parallel", + "survival", + "MASS" + ], + "LazyLoad": "yes", + "ByteCompile": "yes", + "License": "GPL (>= 2)", + "NeedsCompilation": "yes", + "Author": "Simon Wood [aut, cre]", + "Maintainer": "Simon Wood ", + "Repository": "CRAN" }, "microbenchmark": { "Package": "microbenchmark", @@ -1668,6 +2478,60 @@ "stats4" ] }, + "mstate": { + "Package": "mstate", + "Version": "0.3.3", + "Source": "Repository", + "Date": "2024-07-03", + "Title": "Data Preparation, Estimation and Prediction in Multi-State Models", + "Authors@R": "c( person( given = \"Hein\", family = \"Putter\", role = c(\"aut\", \"cre\"), email = \"H.Putter@lumc.nl\"), person( given = \"Liesbeth C.\", family = \"de Wreede\", role = \"aut\" ), person( given = \"Marta\", family = \"Fiocco\", role = \"aut\" ), person( given = \"Ronald B.\", family = \"Geskus\", role = \"ctb\" ), person( given = \"Edouard F.\", family = \"Bonneville\", role = \"aut\" ), person( given = \"Damjan\", family = \"Manevski\", role = \"ctb\" ) )", + "Depends": [ + "survival (>= 3.1)" + ], + "Imports": [ + "rlang", + "data.table", + "lattice", + "RColorBrewer", + "viridisLite" + ], + "Suggests": [ + "cmprsk", + "ggplot2", + "knitr", + "rmarkdown", + "relsurv (>= 2.2-5)" + ], + "Description": "Contains functions for data preparation, descriptives, hazard estimation and prediction with Aalen-Johansen or simulation in competing risks and multi-state models, see Putter, Fiocco, Geskus (2007) .", + "License": "GPL (>= 2)", + "Encoding": "UTF-8", + "URL": "https://github.com/hputter/mstate", + "NeedsCompilation": "yes", + "Repository": "CRAN", + "RoxygenNote": "7.2.3", + "BugReports": "https://github.com/hputter/mstate/issues", + "VignetteBuilder": "knitr", + "Author": "Hein Putter [aut, cre], Liesbeth C. de Wreede [aut], Marta Fiocco [aut], Ronald B. Geskus [ctb], Edouard F. Bonneville [aut], Damjan Manevski [ctb]", + "Maintainer": "Hein Putter " + }, + "muhaz": { + "Package": "muhaz", + "Version": "1.2.6.4", + "Source": "Repository", + "Description": "Produces a smooth estimate of the hazard function for censored data.", + "Author": "S original by Kenneth Hess, R port by R. Gentleman", + "Title": "Hazard Function Estimation in Survival Analysis", + "Depends": [ + "R(>= 2.3)" + ], + "Imports": [ + "survival" + ], + "License": "GPL", + "Maintainer": "David Winsemius ", + "Repository": "CRAN", + "NeedsCompilation": "yes" + }, "multcomp": { "Package": "multcomp", "Version": "1.4-29", @@ -1686,22 +2550,60 @@ "Package": "mvtnorm", "Version": "1.3-3", "Source": "Repository", - "Requirements": [ - "R", + "Title": "Multivariate Normal and t Distributions", + "Date": "2025-01-09", + "Authors@R": "c(person(\"Alan\", \"Genz\", role = \"aut\"), person(\"Frank\", \"Bretz\", role = \"aut\"), person(\"Tetsuhisa\", \"Miwa\", role = \"aut\"), person(\"Xuefei\", \"Mi\", role = \"aut\"), person(\"Friedrich\", \"Leisch\", role = \"ctb\"), person(\"Fabian\", \"Scheipl\", role = \"ctb\"), person(\"Bjoern\", \"Bornkamp\", role = \"ctb\", comment = c(ORCID = \"0000-0002-6294-8185\")), person(\"Martin\", \"Maechler\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Torsten\", \"Hothorn\", role = c(\"aut\", \"cre\"), email = \"Torsten.Hothorn@R-project.org\", comment = c(ORCID = \"0000-0001-8301-0471\")))", + "Description": "Computes multivariate normal and t probabilities, quantiles, random deviates, and densities. Log-likelihoods for multivariate Gaussian models and Gaussian copulae parameterised by Cholesky factors of covariance or precision matrices are implemented for interval-censored and exact data, or a mix thereof. Score functions for these log-likelihoods are available. A class representing multiple lower triangular matrices and corresponding methods are part of this package.", + "Imports": [ "stats" - ] + ], + "Depends": [ + "R(>= 3.5.0)" + ], + "Suggests": [ + "qrng", + "numDeriv" + ], + "License": "GPL-2", + "URL": "http://mvtnorm.R-forge.R-project.org", + "NeedsCompilation": "yes", + "Author": "Alan Genz [aut], Frank Bretz [aut], Tetsuhisa Miwa [aut], Xuefei Mi [aut], Friedrich Leisch [ctb], Fabian Scheipl [ctb], Bjoern Bornkamp [ctb] (), Martin Maechler [ctb] (), Torsten Hothorn [aut, cre] ()", + "Maintainer": "Torsten Hothorn ", + "Repository": "CRAN" }, "nlme": { "Package": "nlme", "Version": "3.1-168", "Source": "Repository", - "Requirements": [ + "Date": "2025-03-31", + "Priority": "recommended", + "Title": "Linear and Nonlinear Mixed Effects Models", + "Authors@R": "c(person(\"José\", \"Pinheiro\", role = \"aut\", comment = \"S version\"), person(\"Douglas\", \"Bates\", role = \"aut\", comment = \"up to 2007\"), person(\"Saikat\", \"DebRoy\", role = \"ctb\", comment = \"up to 2002\"), person(\"Deepayan\", \"Sarkar\", role = \"ctb\", comment = \"up to 2005\"), person(\"EISPACK authors\", role = \"ctb\", comment = \"src/rs.f\"), person(\"Siem\", \"Heisterkamp\", role = \"ctb\", comment = \"Author fixed sigma\"), person(\"Bert\", \"Van Willigen\",role = \"ctb\", comment = \"Programmer fixed sigma\"), person(\"Johannes\", \"Ranke\", role = \"ctb\", comment = \"varConstProp()\"), person(\"R Core Team\", email = \"R-core@R-project.org\", role = c(\"aut\", \"cre\"), comment = c(ROR = \"02zz1nj61\")))", + "Contact": "see 'MailingList'", + "Description": "Fit and compare Gaussian linear and nonlinear mixed-effects models.", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ "graphics", "stats", "utils", - "lattice", - "R" - ] + "lattice" + ], + "Suggests": [ + "MASS", + "SASmixed" + ], + "LazyData": "yes", + "Encoding": "UTF-8", + "License": "GPL (>= 2)", + "BugReports": "https://bugs.r-project.org", + "MailingList": "R-help@r-project.org", + "URL": "https://svn.r-project.org/R-packages/trunk/nlme/", + "NeedsCompilation": "yes", + "Author": "José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), Johannes Ranke [ctb] (varConstProp()), R Core Team [aut, cre] (02zz1nj61)", + "Maintainer": "R Core Team ", + "Repository": "CRAN" }, "nloptr": { "Package": "nloptr", @@ -1731,9 +2633,20 @@ "Package": "numDeriv", "Version": "2016.8-1.1", "Source": "Repository", - "Requirements": [ - "R" - ] + "Title": "Accurate Numerical Derivatives", + "Description": "Methods for calculating (usually) accurate numerical first and second order derivatives. Accurate calculations are done using 'Richardson''s' extrapolation or, when applicable, a complex step derivative is available. A simple difference method is also provided. Simple difference is (usually) less accurate but is much quicker than 'Richardson''s' extrapolation and provides a useful cross-check. Methods are provided for real scalar and vector valued functions.", + "Depends": [ + "R (>= 2.11.1)" + ], + "LazyLoad": "yes", + "ByteCompile": "yes", + "License": "GPL-2", + "Copyright": "2006-2011, Bank of Canada. 2012-2016, Paul Gilbert", + "Author": "Paul Gilbert and Ravi Varadhan", + "Maintainer": "Paul Gilbert ", + "URL": "http://optimizer.r-forge.r-project.org/", + "NeedsCompilation": "no", + "Repository": "CRAN" }, "numbers": { "Package": "numbers", @@ -1855,15 +2768,58 @@ "Package": "pillar", "Version": "1.11.1", "Source": "Repository", - "Requirements": [ - "cli", + "Title": "Coloured Formatting for Columns", + "Authors@R": "c(person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Hadley\", family = \"Wickham\", role = \"aut\"), person(given = \"RStudio\", role = \"cph\"))", + "Description": "Provides 'pillar' and 'colonnade' generics designed for formatting columns of data using the full range of colours provided by modern terminals.", + "License": "MIT + file LICENSE", + "URL": "https://pillar.r-lib.org/, https://github.com/r-lib/pillar", + "BugReports": "https://github.com/r-lib/pillar/issues", + "Imports": [ + "cli (>= 2.3.0)", "glue", "lifecycle", - "rlang", - "utf8", + "rlang (>= 1.0.2)", + "utf8 (>= 1.1.0)", "utils", - "vctrs" - ] + "vctrs (>= 0.5.0)" + ], + "Suggests": [ + "bit64", + "DBI", + "debugme", + "DiagrammeR", + "dplyr", + "formattable", + "ggplot2", + "knitr", + "lubridate", + "nanotime", + "nycflights13", + "palmerpenguins", + "rmarkdown", + "scales", + "stringi", + "survival", + "testthat (>= 3.1.1)", + "tibble", + "units (>= 0.7.2)", + "vdiffr", + "withr" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3.9000", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "format_multi_fuzz, format_multi_fuzz_2, format_multi, ctl_colonnade, ctl_colonnade_1, ctl_colonnade_2", + "Config/autostyle/scope": "line_breaks", + "Config/autostyle/strict": "true", + "Config/gha/extra-packages": "units=?ignore-before-r=4.3.0", + "Config/Needs/website": "tidyverse/tidytemplate", + "NeedsCompilation": "no", + "Author": "Kirill Müller [aut, cre] (ORCID: ), Hadley Wickham [aut], RStudio [cph]", + "Maintainer": "Kirill Müller ", + "Repository": "CRAN" }, "pkgbuild": { "Package": "pkgbuild", @@ -1882,9 +2838,25 @@ "Package": "pkgconfig", "Version": "2.0.3", "Source": "Repository", - "Requirements": [ + "Title": "Private Configuration for 'R' Packages", + "Author": "Gábor Csárdi", + "Maintainer": "Gábor Csárdi ", + "Description": "Set configuration options on a per-package basis. Options set by a given package only apply to that package, other packages are unaffected.", + "License": "MIT + file LICENSE", + "LazyData": "true", + "Imports": [ "utils" - ] + ], + "Suggests": [ + "covr", + "testthat", + "disposables (>= 1.0.3)" + ], + "URL": "https://github.com/r-lib/pkgconfig#readme", + "BugReports": "https://github.com/r-lib/pkgconfig/issues", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Repository": "CRAN" }, "plotly": { "Package": "plotly", @@ -2009,14 +2981,50 @@ "Package": "purrr", "Version": "1.2.1", "Source": "Repository", - "Requirements": [ - "cli", - "lifecycle", - "magrittr", - "R", - "rlang", - "vctrs" - ] + "Title": "Functional Programming Tools", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"https://ror.org/03wc8by49\")) )", + "Description": "A complete and consistent functional programming toolkit for R.", + "License": "MIT + file LICENSE", + "URL": "https://purrr.tidyverse.org/, https://github.com/tidyverse/purrr", + "BugReports": "https://github.com/tidyverse/purrr/issues", + "Depends": [ + "R (>= 4.1)" + ], + "Imports": [ + "cli (>= 3.6.1)", + "lifecycle (>= 1.0.3)", + "magrittr (>= 1.5.0)", + "rlang (>= 1.1.1)", + "vctrs (>= 0.6.3)" + ], + "Suggests": [ + "carrier (>= 0.3.0)", + "covr", + "dplyr (>= 0.7.8)", + "httr", + "knitr", + "lubridate", + "mirai (>= 2.5.1)", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble", + "tidyselect" + ], + "LinkingTo": [ + "cli" + ], + "VignetteBuilder": "knitr", + "Biarch": "true", + "Config/build/compilation-database": "true", + "Config/Needs/website": "tidyverse/tidytemplate, tidyr", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "TRUE", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre] (ORCID: ), Lionel Henry [aut], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "qcc": { "Package": "qcc", @@ -2034,9 +3042,18 @@ "Package": "quadprog", "Version": "1.5-8", "Source": "Repository", - "Requirements": [ - "R" - ] + "Type": "Package", + "Title": "Functions to Solve Quadratic Programming Problems", + "Date": "2019-11-20", + "Author": "S original by Berwin A. Turlach R port by Andreas Weingessel Fortran contributions from Cleve Moler (dposl/LINPACK and (a modified version of) dpodi/LINPACK)", + "Maintainer": "Berwin A. Turlach ", + "Description": "This package contains routines and documentation for solving quadratic programming problems.", + "Depends": [ + "R (>= 3.1.0)" + ], + "License": "GPL (>= 2)", + "NeedsCompilation": "yes", + "Repository": "CRAN" }, "quantmod": { "Package": "quantmod", @@ -2110,10 +3127,52 @@ "Package": "rlang", "Version": "1.1.7", "Source": "Repository", - "Requirements": [ - "R", + "Title": "Functions for Base Types and Core R and 'Tidyverse' Features", + "Description": "A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.", + "Authors@R": "c( person(\"Lionel\", \"Henry\", ,\"lionel@posit.co\", c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", ,\"hadley@posit.co\", \"aut\"), person(given = \"mikefc\", email = \"mikefc@coolbutuseless.com\", role = \"cph\", comment = \"Hash implementation based on Mike's xxhashlite\"), person(given = \"Yann\", family = \"Collet\", role = \"cph\", comment = \"Author of the embedded xxHash library\"), person(given = \"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "License": "MIT + file LICENSE", + "ByteCompile": "true", + "Biarch": "true", + "Depends": [ + "R (>= 4.0.0)" + ], + "Imports": [ "utils" - ] + ], + "Suggests": [ + "cli (>= 3.1.0)", + "covr", + "crayon", + "desc", + "fs", + "glue", + "knitr", + "magrittr", + "methods", + "pillar", + "pkgload", + "rmarkdown", + "stats", + "testthat (>= 3.2.0)", + "tibble", + "usethis", + "vctrs (>= 0.2.3)", + "withr" + ], + "Enhances": [ + "winch" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "URL": "https://rlang.r-lib.org, https://github.com/r-lib/rlang", + "BugReports": "https://github.com/r-lib/rlang/issues", + "Config/build/compilation-database": "true", + "Config/testthat/edition": "3", + "Config/Needs/website": "dplyr, tidyverse/tidytemplate", + "NeedsCompilation": "yes", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), Posit, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" }, "rmarkdown": { "Package": "rmarkdown", @@ -2176,6 +3235,59 @@ "utils" ] }, + "rstpm2": { + "Package": "rstpm2", + "Version": "1.7.1", + "Source": "Repository", + "Type": "Package", + "Title": "Smooth Survival Models, Including Generalized Survival Models", + "Authors@R": "c(person(\"Mark\", \"Clements\", role = c(\"aut\", \"cre\"), email = \"mark.clements@ki.se\"), person(\"Xing-Rong\", \"Liu\", role = \"aut\", email = \"xingrong.liu@ki.se\"), person(\"Benjamin\", \"Christoffersen\", role = \"aut\", email = \"benjamin.christoffersen@ki.se\"), person(\"Paul\", \"Lambert\", role = \"ctb\", email=\"pl4@leicester.ac.uk\"), person(\"Lasse\", \"Hjort Jakobsen\", role = \"ctb\", email=\"lasse.j@rn.dk\"), person(\"Alessandro\", \"Gasparini\", role = \"ctb\"), person(\"Gordon\",\"Smyth\", role=\"cph\"), person(\"Patrick\",\"Alken\", role=\"cph\"), person(\"Simon\",\"Wood\", role=\"cph\"), person(\"Rhys\",\"Ulerich\", role=\"cph\"))", + "Depends": [ + "R (>= 3.0.2)", + "methods", + "survival", + "splines" + ], + "Imports": [ + "graphics", + "Rcpp (>= 0.10.2)", + "stats", + "mgcv", + "bbmle (>= 1.0.20)", + "fastGHQuad", + "utils", + "parallel", + "mvtnorm", + "numDeriv", + "lsoda" + ], + "Suggests": [ + "eha", + "testthat", + "ggplot2", + "lattice", + "readstata13", + "mstate", + "scales", + "survPen", + "flexsurv", + "timereg" + ], + "LinkingTo": [ + "Rcpp", + "RcppArmadillo" + ], + "Maintainer": "Mark Clements ", + "Description": "R implementation of generalized survival models (GSMs), smooth accelerated failure time (AFT) models and Markov multi-state models. For the GSMs, g(S(t|x))=eta(t,x) for a link function g, survival S at time t with covariates x and a linear predictor eta(t,x). The main assumption is that the time effect(s) are smooth . For fully parametric models with natural splines, this re-implements Stata's 'stpm2' function, which are flexible parametric survival models developed by Royston and colleagues. We have extended the parametric models to include any smooth parametric smoothers for time. We have also extended the model to include any smooth penalized smoothers from the 'mgcv' package, using penalized likelihood. These models include left truncation, right censoring, interval censoring, gamma frailties and normal random effects , and copulas. For the smooth AFTs, S(t|x) = S_0(t*eta(t,x)), where the baseline survival function S_0(t)=exp(-exp(eta_0(t))) is modelled for natural splines for eta_0, and the time-dependent cumulative acceleration factor eta(t,x)=\\int_0^t exp(eta_1(u,x)) du for log acceleration factor eta_1(u,x). The Markov multi-state models allow for a range of models with smooth transitions to predict transition probabilities, length of stay, utilities and costs, with differences, ratios and standardisation.", + "URL": "https://github.com/mclements/rstpm2", + "BugReports": "https://github.com/mclements/rstpm2/issues", + "License": "GPL-2 | GPL-3", + "LazyData": "yes", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Mark Clements [aut, cre], Xing-Rong Liu [aut], Benjamin Christoffersen [aut], Paul Lambert [ctb], Lasse Hjort Jakobsen [ctb], Alessandro Gasparini [ctb], Gordon Smyth [cph], Patrick Alken [cph], Simon Wood [cph], Rhys Ulerich [cph]", + "Repository": "CRAN" + }, "rstudioapi": { "Package": "rstudioapi", "Version": "0.18.0", @@ -2224,18 +3336,45 @@ "Package": "scales", "Version": "1.4.0", "Source": "Repository", - "Requirements": [ + "Title": "Scale Functions for Visualization", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Dana\", \"Seidel\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Graphical scales map data to aesthetics, and provide methods for automatically determining breaks and labels for axes and legends.", + "License": "MIT + file LICENSE", + "URL": "https://scales.r-lib.org, https://github.com/r-lib/scales", + "BugReports": "https://github.com/r-lib/scales/issues", + "Depends": [ + "R (>= 4.1)" + ], + "Imports": [ "cli", - "farver", + "farver (>= 2.0.3)", "glue", "labeling", "lifecycle", - "R", "R6", "RColorBrewer", - "rlang", + "rlang (>= 1.1.0)", "viridisLite" - ] + ], + "Suggests": [ + "bit64", + "covr", + "dichromat", + "ggplot2", + "hms (>= 0.5.0)", + "stringi", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-04-23", + "Encoding": "UTF-8", + "LazyLoad": "yes", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [cre, aut] (), Dana Seidel [aut], Posit Software, PBC [cph, fnd] (03wc8by49)", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "CRAN" }, "scatterplot3d": { "Package": "scatterplot3d", @@ -2272,31 +3411,105 @@ "utils" ] }, + "statmod": { + "Package": "statmod", + "Version": "1.5.1", + "Source": "Repository", + "Date": "2025-10-08", + "Title": "Statistical Modeling", + "Authors@R": "c(person(given = \"Gordon\", family = \"Smyth\", role = c(\"cre\", \"aut\"), email = \"smyth@wehi.edu.au\"), person(given = \"Lizhong\", family = \"Chen\", role = \"aut\"), person(given = \"Yifang\", family = \"Hu\", role = \"ctb\"), person(given = \"Peter\", family = \"Dunn\", role = \"ctb\"), person(given = \"Belinda\", family = \"Phipson\", role = \"ctb\"), person(given = \"Yunshun\", family = \"Chen\", role = \"ctb\"))", + "Maintainer": "Gordon Smyth ", + "Depends": [ + "R (>= 3.0.0)" + ], + "Imports": [ + "stats", + "graphics" + ], + "Suggests": [ + "MASS", + "tweedie" + ], + "Description": "A collection of algorithms and functions to aid statistical modeling. Includes limiting dilution analysis (aka ELDA), growth curve comparisons, mixed linear models, heteroscedastic regression, inverse-Gaussian probability calculations, Gauss quadrature and a secure convergence algorithm for nonlinear models. Also includes advanced generalized linear model functions including Tweedie and Digamma distributional families, secure convergence and exact distributional calculations for unit deviances.", + "License": "GPL-2 | GPL-3", + "NeedsCompilation": "yes", + "Author": "Gordon Smyth [cre, aut], Lizhong Chen [aut], Yifang Hu [ctb], Peter Dunn [ctb], Belinda Phipson [ctb], Yunshun Chen [ctb]", + "Repository": "CRAN" + }, "stringi": { "Package": "stringi", "Version": "1.8.7", "Source": "Repository", - "Requirements": [ - "R", - "stats", + "Date": "2025-03-27", + "Title": "Fast and Portable Character String Processing Facilities", + "Description": "A collection of character string/text/natural language processing tools for pattern searching (e.g., with 'Java'-like regular expressions or the 'Unicode' collation algorithm), random string generation, case mapping, string transliteration, concatenation, sorting, padding, wrapping, Unicode normalisation, date-time formatting and parsing, and many more. They are fast, consistent, convenient, and - thanks to 'ICU' (International Components for Unicode) - portable across all locales and platforms. Documentation about 'stringi' is provided via its website at and the paper by Gagolewski (2022, ).", + "URL": "https://stringi.gagolewski.com/, https://github.com/gagolews/stringi, https://icu.unicode.org/", + "BugReports": "https://github.com/gagolews/stringi/issues", + "SystemRequirements": "ICU4C (>= 61, optional)", + "Type": "Package", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ "tools", - "utils" - ] + "utils", + "stats" + ], + "Biarch": "TRUE", + "License": "file LICENSE", + "Authors@R": "c(person(given = \"Marek\", family = \"Gagolewski\", role = c(\"aut\", \"cre\", \"cph\"), email = \"marek@gagolewski.com\", comment = c(ORCID = \"0000-0003-0637-6028\")), person(given = \"Bartek\", family = \"Tartanus\", role = \"ctb\"), person(\"Unicode, Inc. and others\", role=\"ctb\", comment = \"ICU4C source code, Unicode Character Database\") )", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Marek Gagolewski [aut, cre, cph] (), Bartek Tartanus [ctb], Unicode, Inc. and others [ctb] (ICU4C source code, Unicode Character Database)", + "Maintainer": "Marek Gagolewski ", + "License_is_FOSS": "yes", + "Repository": "CRAN" }, "stringr": { "Package": "stringr", "Version": "1.6.0", "Source": "Repository", - "Requirements": [ + "Title": "Simple, Consistent Wrappers for Common String Operations", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\", \"cph\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) are consistent, all functions deal with \"NA\"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another.", + "License": "MIT + file LICENSE", + "URL": "https://stringr.tidyverse.org, https://github.com/tidyverse/stringr", + "BugReports": "https://github.com/tidyverse/stringr/issues", + "Depends": [ + "R (>= 4.1.0)" + ], + "Imports": [ "cli", - "glue", - "lifecycle", + "glue (>= 1.6.1)", + "lifecycle (>= 1.0.3)", "magrittr", - "R", - "rlang", - "stringi", - "vctrs" - ] + "rlang (>= 1.0.0)", + "stringi (>= 1.5.3)", + "vctrs (>= 0.4.0)" + ], + "Suggests": [ + "covr", + "dplyr", + "gt", + "htmltools", + "htmlwidgets", + "knitr", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/potools/style": "explicit", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre, cph], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "strucchange": { "Package": "strucchange", @@ -2315,15 +3528,31 @@ "Package": "survival", "Version": "3.8-6", "Source": "Repository", - "Requirements": [ + "Title": "Survival Analysis", + "Priority": "recommended", + "Date": "2026-01-09", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ "graphics", "Matrix", "methods", - "R", "splines", "stats", "utils" - ] + ], + "LazyData": "Yes", + "LazyDataCompression": "xz", + "ByteCompile": "Yes", + "Authors@R": "c(person(c(\"Terry\", \"M\"), \"Therneau\", email=\"therneau.terry@mayo.edu\", role=c(\"aut\", \"cre\")), person(\"Thomas\", \"Lumley\", role=c(\"ctb\", \"trl\"), comment=\"original S->R port and R maintainer until 2009\"), person(\"Atkinson\", \"Elizabeth\", role=\"ctb\"), person(\"Crowson\", \"Cynthia\", role=\"ctb\"))", + "Description": "Contains the core survival analysis routines, including definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models.", + "License": "LGPL (>= 2)", + "URL": "https://github.com/therneau/survival", + "NeedsCompilation": "yes", + "Author": "Terry M Therneau [aut, cre], Thomas Lumley [ctb, trl] (original S->R port and R maintainer until 2009), Atkinson Elizabeth [ctb], Crowson Cynthia [ctb]", + "Maintainer": "Terry M Therneau ", + "Repository": "CRAN" }, "svglite": { "Package": "svglite", @@ -2379,18 +3608,66 @@ "Package": "tibble", "Version": "3.3.1", "Source": "Repository", - "Requirements": [ + "Title": "Simple Data Frames", + "Authors@R": "c( person(\"Kirill\", \"Müller\", , \"kirill@cynkra.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-1416-3412\")), person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = \"aut\"), person(\"Romain\", \"Francois\", , \"romain@r-enthusiasts.com\", role = \"ctb\"), person(\"Jennifer\", \"Bryan\", , \"jenny@rstudio.com\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides a 'tbl_df' class (the 'tibble') with stricter checking and better formatting than the traditional data frame.", + "License": "MIT + file LICENSE", + "URL": "https://tibble.tidyverse.org/, https://github.com/tidyverse/tibble", + "BugReports": "https://github.com/tidyverse/tibble/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Imports": [ "cli", - "lifecycle", + "lifecycle (>= 1.0.0)", "magrittr", "methods", - "pillar", + "pillar (>= 1.8.1)", "pkgconfig", - "R", - "rlang", + "rlang (>= 1.0.2)", "utils", - "vctrs" - ] + "vctrs (>= 0.5.0)" + ], + "Suggests": [ + "bench", + "bit64", + "blob", + "brio", + "callr", + "DiagrammeR", + "dplyr", + "evaluate", + "formattable", + "ggplot2", + "here", + "hms", + "htmltools", + "knitr", + "lubridate", + "nycflights13", + "pkgload", + "purrr", + "rmarkdown", + "stringi", + "testthat (>= 3.0.2)", + "tidyr", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/autostyle/rmd": "false", + "Config/autostyle/scope": "line_breaks", + "Config/autostyle/strict": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "vignette-formats, as_tibble, add, invariants", + "Config/usethis/last-upkeep": "2025-06-07", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3.9000", + "NeedsCompilation": "yes", + "Author": "Kirill Müller [aut, cre] (ORCID: ), Hadley Wickham [aut], Romain Francois [ctb], Jennifer Bryan [ctb], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Kirill Müller ", + "Repository": "CRAN" }, "tidyplots": { "Package": "tidyplots", @@ -2423,36 +3700,95 @@ "Package": "tidyr", "Version": "1.3.2", "Source": "Repository", - "Requirements": [ - "cli", - "cpp11", - "dplyr", + "Title": "Tidy Messy Data", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\"), person(\"Maximilian\", \"Girlich\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevin@posit.co\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools to help to create tidy data, where each column is a variable, each row is an observation, and each cell contains a single value. 'tidyr' contains tools for changing the shape (pivoting) and hierarchy (nesting and 'unnesting') of a dataset, turning deeply nested lists into rectangular data frames ('rectangling'), and extracting values out of string columns. It also includes tools for working with missing values (both implicit and explicit).", + "License": "MIT + file LICENSE", + "URL": "https://tidyr.tidyverse.org, https://github.com/tidyverse/tidyr", + "BugReports": "https://github.com/tidyverse/tidyr/issues", + "Depends": [ + "R (>= 4.1.0)" + ], + "Imports": [ + "cli (>= 3.4.1)", + "dplyr (>= 1.1.0)", "glue", - "lifecycle", + "lifecycle (>= 1.0.3)", "magrittr", - "purrr", - "R", - "rlang", - "stringr", - "tibble", - "tidyselect", + "purrr (>= 1.0.1)", + "rlang (>= 1.1.1)", + "stringr (>= 1.5.0)", + "tibble (>= 2.1.1)", + "tidyselect (>= 1.2.1)", "utils", - "vctrs" - ] + "vctrs (>= 0.5.2)" + ], + "Suggests": [ + "covr", + "data.table", + "knitr", + "readr", + "repurrrsive (>= 1.1.0)", + "rmarkdown", + "testthat (>= 3.0.0)" + ], + "LinkingTo": [ + "cpp11 (>= 0.4.0)" + ], + "VignetteBuilder": "knitr", + "Config/build/compilation-database": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre], Davis Vaughan [aut], Maximilian Girlich [aut], Kevin Ushey [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" }, "tidyselect": { "Package": "tidyselect", "Version": "1.2.1", "Source": "Repository", - "Requirements": [ - "cli", - "glue", - "lifecycle", - "R", - "rlang", - "vctrs", + "Title": "Select from a Set of Strings", + "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A backend for the selecting functions of the 'tidyverse'. It makes it easy to implement select-like functions in your own packages in a way that is consistent with other 'tidyverse' interfaces for selection.", + "License": "MIT + file LICENSE", + "URL": "https://tidyselect.r-lib.org, https://github.com/r-lib/tidyselect", + "BugReports": "https://github.com/r-lib/tidyselect/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "cli (>= 3.3.0)", + "glue (>= 1.3.0)", + "lifecycle (>= 1.0.3)", + "rlang (>= 1.0.4)", + "vctrs (>= 0.5.2)", "withr" - ] + ], + "Suggests": [ + "covr", + "crayon", + "dplyr", + "knitr", + "magrittr", + "rmarkdown", + "stringr", + "testthat (>= 3.1.1)", + "tibble (>= 2.1.3)" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/testthat/edition": "3", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.0.9000", + "NeedsCompilation": "yes", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" }, "timeDate": { "Package": "timeDate", @@ -2514,9 +3850,32 @@ "Package": "utf8", "Version": "1.2.6", "Source": "Repository", - "Requirements": [ - "R" - ] + "Title": "Unicode Text Processing", + "Authors@R": "c(person(given = c(\"Patrick\", \"O.\"), family = \"Perry\", role = c(\"aut\", \"cph\")), person(given = \"Kirill\", family = \"M\\u00fcller\", role = \"cre\", email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Unicode, Inc.\", role = c(\"cph\", \"dtc\"), comment = \"Unicode Character Database\"))", + "Description": "Process and print 'UTF-8' encoded international text (Unicode). Input, validate, normalize, encode, format, and display.", + "License": "Apache License (== 2.0) | file LICENSE", + "URL": "https://krlmlr.github.io/utf8/, https://github.com/krlmlr/utf8", + "BugReports": "https://github.com/krlmlr/utf8/issues", + "Depends": [ + "R (>= 2.10)" + ], + "Suggests": [ + "cli", + "covr", + "knitr", + "rlang", + "rmarkdown", + "testthat (>= 3.0.0)", + "withr" + ], + "VignetteBuilder": "knitr, rmarkdown", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2.9000", + "NeedsCompilation": "yes", + "Author": "Patrick O. Perry [aut, cph], Kirill Müller [cre] (ORCID: ), Unicode, Inc. [cph, dtc] (Unicode Character Database)", + "Maintainer": "Kirill Müller ", + "Repository": "CRAN" }, "uuid": { "Package": "uuid", @@ -2545,13 +3904,50 @@ "Package": "vctrs", "Version": "0.7.0", "Source": "Repository", - "Requirements": [ - "cli", + "Title": "Vector Helpers", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = c(\"aut\", \"cre\")), person(\"data.table team\", role = \"cph\", comment = \"Radix sort based on data.table's forder() and their contribution to R's order()\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Defines new notions of prototype and size that are used to provide tools for consistent and well-founded type-coercion and size-recycling, and are in turn connected to ideas of type- and size-stability useful for analysing function interfaces.", + "License": "MIT + file LICENSE", + "URL": "https://vctrs.r-lib.org/, https://github.com/r-lib/vctrs", + "BugReports": "https://github.com/r-lib/vctrs/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Imports": [ + "cli (>= 3.4.0)", "glue", - "lifecycle", - "R", - "rlang" - ] + "lifecycle (>= 1.0.3)", + "rlang (>= 1.1.7)" + ], + "Suggests": [ + "bit64", + "covr", + "crayon", + "dplyr (>= 0.8.5)", + "generics", + "knitr", + "pillar (>= 1.4.4)", + "pkgdown (>= 2.0.1)", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble (>= 3.1.3)", + "waldo (>= 0.2.0)", + "withr", + "xml2", + "zeallot" + ], + "VignetteBuilder": "knitr", + "Config/build/compilation-database": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Encoding": "UTF-8", + "Language": "en-GB", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut], Lionel Henry [aut], Davis Vaughan [aut, cre], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "CRAN" }, "vipor": { "Package": "vipor", @@ -2567,9 +3963,29 @@ "Package": "viridisLite", "Version": "0.4.2", "Source": "Repository", - "Requirements": [ - "R" - ] + "Type": "Package", + "Title": "Colorblind-Friendly Color Maps (Lite Version)", + "Date": "2023-05-02", + "Authors@R": "c( person(\"Simon\", \"Garnier\", email = \"garnier@njit.edu\", role = c(\"aut\", \"cre\")), person(\"Noam\", \"Ross\", email = \"noam.ross@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Bob\", \"Rudis\", email = \"bob@rud.is\", role = c(\"ctb\", \"cph\")), person(\"Marco\", \"Sciaini\", email = \"sciaini.marco@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Antônio Pedro\", \"Camargo\", role = c(\"ctb\", \"cph\")), person(\"Cédric\", \"Scherer\", email = \"scherer@izw-berlin.de\", role = c(\"ctb\", \"cph\")) )", + "Maintainer": "Simon Garnier ", + "Description": "Color maps designed to improve graph readability for readers with common forms of color blindness and/or color vision deficiency. The color maps are also perceptually-uniform, both in regular form and also when converted to black-and-white for printing. This is the 'lite' version of the 'viridis' package that also contains 'ggplot2' bindings for discrete and continuous color and fill scales and can be found at .", + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "Depends": [ + "R (>= 2.10)" + ], + "Suggests": [ + "hexbin (>= 1.27.0)", + "ggplot2 (>= 1.0.1)", + "testthat", + "covr" + ], + "URL": "https://sjmgarnier.github.io/viridisLite/, https://github.com/sjmgarnier/viridisLite/", + "BugReports": "https://github.com/sjmgarnier/viridisLite/issues/", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Antônio Pedro Camargo [ctb, cph], Cédric Scherer [ctb, cph]", + "Repository": "CRAN" }, "weibullness": { "Package": "weibullness", @@ -2586,11 +4002,39 @@ "Package": "withr", "Version": "3.0.2", "Source": "Repository", - "Requirements": [ + "Title": "Run Code 'With' Temporarily Modified Global State", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Kirill\", \"Müller\", , \"krlmlr+r@mailbox.org\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevinushey@gmail.com\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Jennifer\", \"Bryan\", role = \"ctb\"), person(\"Richard\", \"Cotton\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A set of functions to run code 'with' safely and temporarily modified global state. Many of these functions were originally a part of the 'devtools' package, this provides a simple package with limited dependencies to provide access to these functions.", + "License": "MIT + file LICENSE", + "URL": "https://withr.r-lib.org, https://github.com/r-lib/withr#readme", + "BugReports": "https://github.com/r-lib/withr/issues", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ "graphics", - "grDevices", - "R" - ] + "grDevices" + ], + "Suggests": [ + "callr", + "DBI", + "knitr", + "methods", + "rlang", + "rmarkdown (>= 2.12)", + "RSQLite", + "testthat (>= 3.0.0)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "Collate": "'aaa.R' 'collate.R' 'connection.R' 'db.R' 'defer-exit.R' 'standalone-defer.R' 'defer.R' 'devices.R' 'local_.R' 'with_.R' 'dir.R' 'env.R' 'file.R' 'language.R' 'libpaths.R' 'locale.R' 'makevars.R' 'namespace.R' 'options.R' 'par.R' 'path.R' 'rng.R' 'seed.R' 'wrap.R' 'sink.R' 'tempfile.R' 'timezone.R' 'torture.R' 'utils.R' 'with.R'", + "NeedsCompilation": "no", + "Author": "Jim Hester [aut], Lionel Henry [aut, cre], Kirill Müller [aut], Kevin Ushey [aut], Hadley Wickham [aut], Winston Chang [aut], Jennifer Bryan [ctb], Richard Cotton [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" }, "xfun": { "Package": "xfun", From 9f09bdc792a0678f8bd971a18808ff7c5829424b Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 9 Feb 2026 18:09:04 +0100 Subject: [PATCH 27/29] Fix unit tests --- R/commonQualityControl.R | 6 +++--- .../doeAnalysis/normal-probability-plot-of-residuals27.svg | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 49db0688..570d1376 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -918,10 +918,10 @@ KnownControlStats.RS <- function(N, sigma = 3) { if (!phase2) { distributionPars <- .distributionParameters(plotStatistic[!is.na(plotStatistic)], distribution = tChartDistribution) - shape <- distributionPars$beta + shape <- if (tChartDistribution == "exponential") 1 else distributionPars$beta # weibull with shape 1 is exponential scale <- distributionPars$theta } else { - shape <- if (tChartDistribution == "exponential") 1 else phase2tChartDistributionShape + shape <- if (tChartDistribution == "exponential") 1 else phase2tChartDistributionShape # weibull with shape 1 is exponential scale <- phase2tChartDistributionScale } center <- qweibull(p = .5, shape = shape, scale = scale) @@ -1605,7 +1605,7 @@ KnownControlStats.RS <- function(N, sigma = 3) { # Since there is only one parameter, we also don't need to check if any parameter is fixed beta <- NA # not relevant for this distribution - theta <- 1/expFit$estimate[1] # scale + theta <- 1/unname(expFit$estimate[1]) # scale } ####################### #### Logistic ##### diff --git a/tests/testthat/_snaps/doeAnalysis/normal-probability-plot-of-residuals27.svg b/tests/testthat/_snaps/doeAnalysis/normal-probability-plot-of-residuals27.svg index e7afd3b5..2ae08ee4 100644 --- a/tests/testthat/_snaps/doeAnalysis/normal-probability-plot-of-residuals27.svg +++ b/tests/testthat/_snaps/doeAnalysis/normal-probability-plot-of-residuals27.svg @@ -79,8 +79,8 @@ -2 0 2 -x -y +Theoretical quantiles +Observed quantiles normal-probability-plot-of-residuals27 From 3f6ab7db69a9958625f2deebc0937cdcd0142c21 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 11 Feb 2026 16:22:01 +0100 Subject: [PATCH 28/29] Address Simon's Feedback --- R/commonQualityControl.R | 11 ++---- R/processCapabilityStudies.R | 54 ++++++++++++++++++--------- inst/qml/processCapabilityStudies.qml | 28 +++++++++----- 3 files changed, 59 insertions(+), 34 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 570d1376..4b5592ff 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1478,11 +1478,11 @@ KnownControlStats.RS <- function(N, sigma = 3) { sdlog = lnorm3startSdLog, threshold = lnorm3startThreshold) - dlnorm3Temp <- function(x, meanlog = 0, sdlog = 1, threshold = 0) { + dlnorm3Temp <- function(x, meanlog, sdlog, threshold) { EnvStats::dlnorm3(x, meanlog = meanlog, sdlog = sdlog, threshold = threshold) } .GlobalEnv[["dlnorm3Temp"]] <- dlnorm3Temp - plnorm3Temp <- function(q, meanlog = 0, sdlog = 1, threshold = 0) { + plnorm3Temp <- function(q, meanlog, sdlog, threshold) { EnvStats::plnorm3(q, meanlog = meanlog, sdlog = sdlog, threshold = threshold) } .GlobalEnv[["plnorm3Temp"]] <- plnorm3Temp @@ -1598,14 +1598,11 @@ KnownControlStats.RS <- function(N, sigma = 3) { beta <- NA # not relevant for this distribution theta <- 1/fix.arg[["rate"]] # scale } else { - expFit <- try(fitdistrplus::fitdist(data, "exp", method = "mle")) # since there is only one parameter, there is no parameter to keep fixed - - if (jaspBase::isTryError(expFit)) - stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) # Since there is only one parameter, we also don't need to check if any parameter is fixed + beta <- NA # not relevant for this distribution - theta <- 1/unname(expFit$estimate[1]) # scale + theta <- mean(data, na.rm = TRUE) # scale } ####################### #### Logistic ##### diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 4f0042f2..d8fea3b6 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1883,6 +1883,10 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["nonNormalDistribution"]] == "3ParameterLognormal" | options[["nonNormalDistribution"]] == "3ParameterWeibull") threshold <- distParameters[[i]]$threshold + if (options[['nonNormalMethod' ]] == "percentile") { + lPercentile <- 0.00135 # lower percentile + uPercentile <- 0.99865 # upper percentile + } # calculation of capability indices ##################### @@ -1895,7 +1899,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- qlnorm(p = 0.00135, meanlog = beta, sdlog = theta) + x135 <- qlnorm(p = lPercentile, meanlog = beta, sdlog = theta) x05 <- qlnorm(p = 0.5, meanlog = beta, sdlog = theta) ppl <- (x05 - lsl) / (x05 - x135) } @@ -1909,7 +1913,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- qlnorm(p = 0.99865, meanlog = beta, sdlog = theta) + x99 <- qlnorm(p = uPercentile, meanlog = beta, sdlog = theta) x05 <- qlnorm(p = 0.5, meanlog = beta, sdlog = theta) ppu <- (usl - x05) / (x99 - x05) } @@ -1927,7 +1931,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- qweibull(p = 0.00135, shape = beta, scale = theta) + x135 <- qweibull(p = lPercentile, shape = beta, scale = theta) x05 <- qweibull(p = 0.5, shape = beta, scale = theta) ppl <- (x05 - lsl) / (x05 - x135) } @@ -1942,7 +1946,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- qweibull(p = 0.99865, shape = beta, scale = theta) + x99 <- qweibull(p = uPercentile, shape = beta, scale = theta) x05 <- qweibull(p = 0.5, shape = beta, scale = theta) ppu <- (usl - x05) / (x99 - x05) } @@ -1960,7 +1964,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- FAdist::qlnorm3(p = 0.00135, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention + x135 <- FAdist::qlnorm3(p = lPercentile, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention ppl <- (x05 - lsl) / (x05 - x135) } @@ -1974,7 +1978,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- FAdist::qlnorm3(p = 0.99865, shape = theta, scale = beta, thres = threshold) + x99 <- FAdist::qlnorm3(p = uPercentile, shape = theta, scale = beta, thres = threshold) x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) ppu <- (usl - x05) / (x99 - x05) } @@ -1992,7 +1996,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- FAdist::qweibull3(p = 0.00135, shape = beta, scale = theta, thres = threshold) + x135 <- FAdist::qweibull3(p = lPercentile, shape = beta, scale = theta, thres = threshold) x05 <- FAdist::qweibull3(p = 0.5, shape = beta, scale = theta, thres = threshold) ppl <- (x05 - lsl) / (x05 - x135) } @@ -2006,7 +2010,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- FAdist::qweibull3(p = 0.99865, shape = beta, scale = theta, thres = threshold) + x99 <- FAdist::qweibull3(p = uPercentile, shape = beta, scale = theta, thres = threshold) x05 <- FAdist::qweibull3(p = 0.5, shape = beta, scale = theta, thres = threshold) ppu <- (usl - x05) / (x99 - x05) } @@ -2023,7 +2027,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- qgamma(p = 0.00135, shape = beta, scale = theta) + x135 <- qgamma(p = lPercentile, shape = beta, scale = theta) x05 <- qgamma(p = 0.5, shape = beta, scale = theta) ppl <- (x05 - lsl) / (x05 - x135) } @@ -2037,7 +2041,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- qgamma(p = 0.99865, shape = beta, scale = theta) + x99 <- qgamma(p = uPercentile, shape = beta, scale = theta) x05 <- qgamma(p = 0.5, shape = beta, scale = theta) ppu <- (usl - x05) / (x99 - x05) } @@ -2055,7 +2059,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { ppl <- -zLSL/3 } else { - x135 <- qexp(p = 0.00135, rate = 1/theta) + x135 <- qexp(p = lPercentile, rate = 1/theta) x05 <- qexp(p = 0.5, rate = 1/theta) ppl <- (x05 - lsl) / (x05 - x135) } @@ -2069,7 +2073,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- qexp(p = 0.99865, rate = 1/theta) + x99 <- qexp(p = uPercentile, rate = 1/theta) x05 <- qexp(p = 0.5, rate = 1/theta) ppu <- (usl - x05) / (x99 - x05) } @@ -2086,7 +2090,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- qlogis(p = 0.00135, location = beta, scale = theta) + x135 <- qlogis(p = lPercentile, location = beta, scale = theta) x05 <- qlogis(p = 0.5, location = beta, scale = theta) ppl <- (x05 - lsl) / (x05 - x135) } @@ -2100,7 +2104,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- qlogis(p = 0.99865, location = beta, scale = theta) + x99 <- qlogis(p = uPercentile, location = beta, scale = theta) x05 <- qlogis(p = 0.5, location = beta, scale = theta) ppu <- (usl - x05) / (x99 - x05) } @@ -2117,7 +2121,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- flexsurv::qllogis(p = 0.00135, shape = 1/theta, scale = exp(beta)) + x135 <- flexsurv::qllogis(p = lPercentile, shape = 1/theta, scale = exp(beta)) x05 <- flexsurv::qllogis(p = 0.5, shape = 1/theta, scale = exp(beta)) ppl <- (x05 - lsl) / (x05 - x135) } @@ -2131,7 +2135,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { zUSL <- qnorm(p2) ppu <- zUSL/3 } else { - x99 <- flexsurv::qllogis(p = 0.99865, shape = 1/theta, scale = exp(beta)) + x99 <- flexsurv::qllogis(p = uPercentile, shape = 1/theta, scale = exp(beta)) x05 <- flexsurv::qllogis(p = 0.5, shape = 1/theta, scale = exp(beta)) ppu <- (usl - x05) / (x99 - x05) } @@ -2490,7 +2494,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (!identical(stages, "")) { nStages <- length(unique(dataset[[stages]])) } - if (options[["nullDistribution"]] %in% c("gamma", "exponential", "logistic", "loglogistic")) { + if (options[["nullDistribution"]] %in% c("gamma", "exponential", "logistic", "loglogistic", "3ParameterWeibull", "3ParameterLognormal")) { plot <- createJaspPlot(width = 400, height = 400, title = gettext("Probability plot")) container[["plot"]] <- plot @@ -2980,6 +2984,22 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { p <- p + ggplot2::stat_function(fun = flexsurv::dllogis, args = list(shape = shape, scale = scale), mapping = ggplot2::aes(color = "loglogisticDist")) legendLabel <- gettext("Log-logistic dist.") + } else if (options[['nullDistribution']] == "3ParameterWeibull") { + fit3Weibull <- .distributionParameters(dataCurrentStage, distribution = "3ParameterWeibull", fix.arg = NULL) + shape <- fit3Weibull[["beta"]] + scale <- fit3Weibull[["theta"]] + threshold <- fit3Weibull[["threshold"]] + p <- p + ggplot2::stat_function(fun = FAdist::dweibull3, args = list(shape = shape, scale = scale, thres = threshold), + mapping = ggplot2::aes(color = "3ParamweibullDist")) + legendLabel <- gettext("3-parameter Weibull dist.") + } else if (options[['nullDistribution']] == "3ParameterLognormal") { + fit3lnorm <- .distributionParameters(dataCurrentStage, distribution = "3ParameterLognormal", fix.arg = NULL) + meanlog <- fit3lnorm[["beta"]] + sdlog <- fit3lnorm[["theta"]] + threshold <- fit3lnorm[["threshold"]] + p <- p + ggplot2::stat_function(fun = EnvStats::dlnorm3, args = list( meanlog = meanlog, sdlog = sdlog, threshold = threshold), + mapping = ggplot2::aes(color = "3ParamLogNormalDist")) + legendLabel <- gettext("3-parameter\nlog-normal dist.") } p <- p + ggplot2::scale_color_manual("", values = "dodgerblue", labels = legendLabel) + diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index e3bb1206..ec295c34 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -956,21 +956,29 @@ Form label: qsTr("Null distribution for probability plot") values: [ - { label: qsTr("Normal"), value: "normal" }, - { label: qsTr("Log-normal"), value: "lognormal" }, - { label: qsTr("Weibull"), value: "weibull" }, - { label: qsTr("Gamma"), value: "gamma" }, - { label: qsTr("Exponential"), value: "exponential"}, - { label: qsTr("Logistic"), value: "logistic" }, - { label: qsTr("Log-logistic"), value: "loglogistic"} + { label: qsTr("Normal"), value: "normal" }, + { label: qsTr("Log-normal"), value: "lognormal" }, + { label: qsTr("Weibull"), value: "weibull" }, + { label: qsTr("Gamma"), value: "gamma" }, + { label: qsTr("Exponential"), value: "exponential"}, + { label: qsTr("Logistic"), value: "logistic" }, + { label: qsTr("Log-logistic"), value: "loglogistic"}, + { label: qsTr("3-parameter Weibull"), value: "3ParameterWeibull"}, + { label: qsTr("3-parameter log-normal"), value: "3ParameterLognormal"} + + + + ] indexDefaultValue: (capabilityStudyType.value == "nonNormalCapabilityAnalysis") ? - (nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal") ? 1 : - (nonNormalDistribution.currentValue == "3ParameterWeibull" || nonNormalDistribution.currentValue == "weibull") ? 2 : + (nonNormalDistribution.currentValue == "lognormal") ? 1 : + (nonNormalDistribution.currentValue == "weibull") ? 2 : (nonNormalDistribution.currentValue == "gamma") ? 3 : (nonNormalDistribution.currentValue == "exponential") ? 4 : (nonNormalDistribution.currentValue == "logistic") ? 5 : - (nonNormalDistribution.currentValue == "loglogistic") ? 6 : 0 + (nonNormalDistribution.currentValue == "loglogistic") ? 6 : + (nonNormalDistribution.currentValue == "3ParameterWeibull") ? 7 : + (nonNormalDistribution.currentValue == "3ParameterLognormal") ? 8 : 0 : 0 } From 6a906dd113571654264c0e9a435266aad11bcf98 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 13 Feb 2026 16:07:29 +0100 Subject: [PATCH 29/29] Extend check for negative values --- R/processCapabilityStudies.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index d8fea3b6..d667be92 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1688,7 +1688,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { footnotes <- paste0(footnotes, gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL). ")) } - if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull") && + if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull" + || options[["nullDistribution"]] == "3ParameterLognormal"|| options[["nullDistribution"]] == "3ParameterWeibull") && any(na.omit(unlist(dataset[measurements])) < 0)) { table$setError(gettext("Dataset contains negative numbers. Not compatible with the selected distribution.")) container[["summaryTableNonNormal"]] <- table @@ -2560,7 +2561,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table$addFootnote(gettextf("Red dotted lines in the probability plot below represent a 95%% confidence interval.")) if (nStages > 1) table$addFootnote(gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL).")) - if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull") && + if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull" + || options[["nullDistribution"]] == "3ParameterLognormal"|| options[["nullDistribution"]] == "3ParameterWeibull") && any(na.omit(unlist(dataset[measurements])) < 0)) { table$setError(gettext("Dataset contains negative numbers. Not compatible with the selected distribution.")) container[["probabilityTable"]] <- table @@ -2648,7 +2650,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { plotHeight <- nRow * 600 plot <- createJaspPlot(width = plotWidth, height = plotHeight, title = gettextf("Probability plot against %1$s distribution", distributionTitle)) - if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull") && + if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull" + || options[["nullDistribution"]] == "3ParameterLognormal"|| options[["nullDistribution"]] == "3ParameterWeibull") && any(na.omit(unlist(dataset[measurements])) < 0)) { plot$setError(gettext("Dataset contains negative numbers. Not compatible with the selected distribution.")) return(plot) @@ -2887,7 +2890,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { sum(!is.na(dataset[measurements])))) return() } - if (options[["histogramDensityLine"]] && (options[['nullDistribution']] == "weibull" || options[['nullDistribution']] == "lognormal") && + if (options[["histogramDensityLine"]] && (options[['nullDistribution']] == "weibull" || options[['nullDistribution']] == "lognormal" + || options[["nullDistribution"]] == "3ParameterLognormal"|| options[["nullDistribution"]] == "3ParameterWeibull") && (any(na.omit(unlist(dataset[measurements])) < 0))) { plot$setError(gettext("Dataset contains negative numbers. Could not overlay the selected distribution.")) return()