compare_plot | R Documentation |
Plot compare information of the train set and test set included in the "split_df" class.
compare_plot(.data, ...)
.data |
an object of class "split_df", usually, a result of a call to split_df(). |
... |
one or more unquoted expressions separated by commas. Select the variable you want to plotting. You can treat variable names like they are positions. Positive values select variables; negative values to drop variables. If the first expression is negative, compare_target_category() will automatically start with all variables. These arguments are automatically quoted and evaluated in a context where column names represent column positions. They support unquoting and splicing. |
The numerical variables are density plots and the categorical variables are mosaic plots to compare the distribution of train sets and test sets.
There is no return value. Draw only the plot.
library(dplyr)
# Credit Card Default Data
head(ISLR::Default)
# Generate data for the example
sb <- ISLR::Default %>%
split_by(default)
sb %>%
compare_plot("income")
sb %>%
compare_plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.