From 81b5cead797aa0ac263f80854b9718618794a352 Mon Sep 17 00:00:00 2001 From: Vladimir Khodygo Date: Wed, 4 Oct 2023 21:24:52 +0100 Subject: [PATCH] ENH: skip missing data pattern check when minpuc == 0 --- R/quickpred.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/quickpred.R b/R/quickpred.R index 9ac43bfb6..569cf13e7 100644 --- a/R/quickpred.R +++ b/R/quickpred.R @@ -106,9 +106,11 @@ quickpred <- function(data, mincor = 0.1, minpuc = 0, include = "", predictorMatrix[maxc > mincor] <- 1 # exclude predictors with a percentage usable cases below minpuc - p <- md.pairs(data) - puc <- p$mr / (p$mr + p$mm) - predictorMatrix[puc < minpuc] <- 0 + if (minpuc != 0) { + p <- md.pairs(data) + puc <- p$mr / (p$mr + p$mm) + predictorMatrix[puc < minpuc] <- 0 + } # exclude predictors listed in the exclude argument yz <- pmatch(exclude, names(data))