extract | R Documentation |
The extract() extract binned variable from "bins", "optimal_bins" class object.
extract(x)
## S3 method for class 'bins'
extract(x)
x |
a bins class or optimal_bins class. |
The "bins" and "optimal_bins" class objects use the summary() and plot() functions to diagnose the performance of binned results. This function is used to extract the binned result if you are satisfied with the result.
factor.
binning
, binning_by
.
library(dplyr)
# Generate data for the example
heartfailure2 <- heartfailure
heartfailure2[sample(seq(NROW(heartfailure2)), 5), "creatinine"] <- NA
# optimal binning using binning_by()
bin <- binning_by(heartfailure2, "death_event", "creatinine")
bin
if (!is.null(bin)) {
# extract binning result
extract(bin) %>%
head(20)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.