convert_df_to_categoric: Convert every column in a data frame to character

Description Usage Arguments Value Examples

Description

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.

Usage

1

Arguments

data

input data frame to discretize

n_bins

number of bins/segments for each variable

Value

data frame containing all variables as character

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# before
df_status(heart_disease)

# after
new_df=convert_df_to_categoric(data=heart_disease, n_bins=5)
df_status(new_df)

## End(Not run)

funModeling documentation built on July 1, 2020, 5:40 p.m.