convert_df_to_categoric | R Documentation |
It converts all the variables present in 'data' to character. Criteria conversion is based on
two functions, discretize_get_bins
plus discretize_df
, which will discretize
all the numerical variables based on equal frequency criteria, with the number of bins equal to 'n_bins'.
This only applies for numerical variables which unique valuesare more than 'n_bins' parameter.
After this step, it may happen that variables remain non-character, so these variables will be converting
directly into character.
convert_df_to_categoric(data, n_bins)
data |
input data frame to discretize |
n_bins |
number of bins/segments for each variable |
data frame containing all variables as character
# before
df_status(heart_disease)
# after
new_df=convert_df_to_categoric(data=heart_disease, n_bins=5)
df_status(new_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.