From b4538e39ecfb3e76172a8a59139e7dbb28f7742a Mon Sep 17 00:00:00 2001 From: Nathalie Vialaneix <nathalie.vialaneix@inrae.fr> Date: Wed, 15 Mar 2023 18:33:18 +0100 Subject: [PATCH] fixed a minor bug in quality --- R/sfcb_methods.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/sfcb_methods.R b/R/sfcb_methods.R index 2f35738..25a28b4 100644 --- a/R/sfcb_methods.R +++ b/R/sfcb_methods.R @@ -203,7 +203,7 @@ quality.SFCB <- function(object, ground_truth, threshold = NULL) { stop(paste("'ground_truth' must have a length identical to initial number ", "of variables.")) - if (!is.null(threshold) && !is.numeric(threshold) && threshold <= 0) + if (!is.null(threshold) && (!is.numeric(threshold) || threshold <= 0)) stop("'threshold' must be a positive number or NULL.") if (is.null(threshold) & !("selected" %in% names(object))) -- GitLab