Skip to content

Commit 441c4ed

Browse files
committed
gemini suggested fixes
1 parent 55d9e9c commit 441c4ed

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

R/check_collinearity.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ check_collinearity.zerocount <- function(
526526
} else if (anyNA(v)) {
527527
# If no attribute exists, then we need to identify NA columns manually
528528
# fixme: this should be ficef in insight::get_varcov() to avoid this step
529-
idx_na <- apply(is.na(m), 2, all)
529+
idx_na <- apply(is.na(v), 2, all)
530530
na_cols <- colnames(v)[idx_na]
531531
keep_idx[idx_na] <- FALSE
532532
}
@@ -549,7 +549,7 @@ check_collinearity.zerocount <- function(
549549
}
550550

551551
# Safely subset the matrix
552-
if (any(!keep_idx) < ncol(v)) {
552+
if (sum(keep_idx) < ncol(v)) {
553553
if (!is.null(term_assign) && length(term_assign) == ncol(v)) {
554554
term_assign <- term_assign[keep_idx]
555555
}

tests/testthat/test-check_collinearity.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,5 +429,3 @@ test_that("check_collinearity, rank deficient.", {
429429
)
430430
expect_identical(out1$VIF, out2$VIF)
431431
})
432-
433-
debugonce(performance:::.check_collinearity)

0 commit comments

Comments
 (0)