split_columns: Split data into discrete and continuous parts

View source: R/split_columns.r

split_columnsR Documentation

Split data into discrete and continuous parts

Description

This function splits the input data into two data.table objects: discrete and continuous. A feature is continuous if is.numeric returns TRUE.

Usage

split_columns(data, binary_as_factor = FALSE)

Arguments

data

input data

binary_as_factor

treat binary as categorical? Default is FALSE.

Details

Features with all missing values will be dropped from the output data, but will be counted towards the column count.

The elements in the output list will have the same class as the input data.

Value

discrete all discrete features

continous all continuous features

num_discrete number of discrete features

num_continuous number of continuous features

num_all_missing number of features with no observations (all values are missing)

Examples

output <- split_columns(iris)
output$discrete
output$continuous
output$num_discrete
output$num_continuous
output$num_all_missing

boxuancui/eda documentation built on Feb. 2, 2024, 1:54 a.m.