data_type Identify features of different data types.

data_type(df)

Arguments

df

data.frame Original feature dataframe containing one column for each feature.

Value

list of data.frame ($num, $cat) Stores the categorical and numerical columns separately as two dataframes in one list. The first element in the list will contain categorical dataframe and the second will contain numerical dataframe.

Examples

my_data <- data.frame(fruits = c('apple', 'banana', 'pear'), counts = c(1, 2, 3), price = c(0, 1, 2)) data_type(my_data)$num
#> counts price #> 1 1 0 #> 2 2 1 #> 3 3 2
data_type(my_data)$cat
#> fruits #> 1 apple #> 2 banana #> 3 pear