microsoft / vivainsights

R library to analyze and visualize data from Viva Insights Analyst Experience
https://microsoft.github.io/vivainsights/
Other
11 stars 2 forks source link

Issue in create_IV : function doesn't validate the inputs #32

Closed sachinstl closed 4 months ago

sachinstl commented 5 months ago

If data, predictors, or outcome are not properly specified, the function might fail without a clear error message. In short function doesn't validate the inputs.

  pq_data %>%
    dplyr::mutate(X = ifelse(Internal_network_size > 40, 0, 0)) %>%
    create_IV(outcome = "X",
              predictors = c("Email_hours", "Meeting_hours"),
              return = "plot")
image

Improvement: We can add input validation to ensure the data is a data frame, predictors are columns in the data, and outcome is a binary variable in the data.