Fixed .check_multicollinearity util function - #769
Conversation
was setup so that it could never flag probable collinearity (>0.9). Changed so that it now will flag this.
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in R/utils_check_collinearity.R where the results data frame was being overwritten during the first threshold filtering, which incorrectly affected the subsequent filtering step. The fix introduces separate variables possible_collinear and probable_collinear for each filtering step. The reviewer feedback recommends using which() when subsetting the data frames to robustly handle potential NA values in the correlation column and prevent introducing NA rows.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Description
The .check_multicollinearity function previously was setup so that it could never flag probable collinearity (>0.9), becuase the filtering by the first threshold changed the results df.
Proposed Changes
Changed so that either threshold can be triggered (created a different df for probable and possible collinearity)
Notes
First PR so please let me know if I have done anything incorrectly!