# Generate data for the example
heartfailure2 <- heartfailure[, c("hblood_pressure", "smoking", "death_event")]
heartfailure2[sample(seq(NROW(heartfailure2)), 5), "smoking"] <- NA
# Compare the all categorical variables
all_var <- compare_category(heartfailure2)
# plot all pair of variables
plot(all_var)
# Compare the two categorical variables
two_var <- compare_category(heartfailure2, smoking, death_event)
# plot a pair of variables
plot(two_var)
# plot a pair of variables without NA
plot(two_var, na.rm = TRUE)
# plot a pair of variables not focuses on typographic elements
plot(two_var, typographic = FALSE)
Run the code above in your browser using DataLab