# the target variable is a categorical variable
categ <- target_by(heartfailure, death_event)
plot_outlier(categ, sodium)
# plot_outlier(categ, sodium, typographic = FALSE)
# death_eventing dplyr
library(dplyr)
heartfailure %>%
target_by(death_event) %>%
plot_outlier(sodium, cpk_enzyme)
## death_eventing DBMS tables ----------------------------------
# If you have the 'DBI' and 'RSQLite' packages installed, perform the code block:
if (FALSE) {
# connect DBMS
con_sqlite <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# copy heartfailure to the DBMS with a table named TB_HEARTFAILURE
copy_to(con_sqlite, heartfailure, name = "TB_HEARTFAILURE", overwrite = TRUE)
# If the target variable is a categorical variable
categ <- target_by(con_sqlite %>% tbl("TB_HEARTFAILURE") , death_event)
plot_outlier(categ, sodium)
# Disconnect DBMS
DBI::dbDisconnect(con_sqlite)
}
Run the code above in your browser using DataLab