From dc5460ecf63bc4c4f955487e1795672bc363f11d Mon Sep 17 00:00:00 2001 From: Michael Hahsler Date: Fri, 15 May 2020 11:17:01 -0500 Subject: [PATCH] stdLift: missing minimum support/conf info now causes a warning instead of an error. --- R/interestMeasures.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/interestMeasures.R b/R/interestMeasures.R index 34cfc6c..17eff0c 100644 --- a/R/interestMeasures.R +++ b/R/interestMeasures.R @@ -596,8 +596,10 @@ setMethod("interestMeasure", signature(x = "rules"), c <- info(rules)$confidence s <- info(rules)$support - if(is.null(c) || is.null(s)) stop("support or confidence info not available in rules. Use uncorrected std_lift instead.") - lambda <- pmax(lambda, 4*s/(1+s)^2, s/(supp_A * supp_B), c/supp_B) + if(!is.null(c) && !is.null(s)) + lambda <- pmax(lambda, 4*s/(1+s)^2, s/(supp_A * supp_B), c/supp_B) + else + warning("minimum support or confidence not available in info(x). Using uncorrected std_lift instead.") } # lower bound of lift