is_continuous: guess if a vector is continuous

Description Usage Arguments Details Value

View source: R/formatting_p.R

Description

we treat character as categorial; double as continuous; for integer/numeric/double, we can specify a minimum categories to be continuous variable

Usage

1
is_continuous(vec, minCat = 10)

Arguments

vec

a vector

minCat

an integer specifying minimum categories required to be a continuous variable for integers

Details

a vector of class character is for sure categorical and would be good to handled as a factor in R. The class numeric can be either integer (is.integer) or double (is.double). If is.double, then we should treat it as continuous when it has enough categories (binary can be stored as double mode!). For is.integer, when there is less than 5 categories, i.e., it is better treated as categorical.

Value

TRUE for continuous and FALSE for anything else


nickytong/GenAnalysis documentation built on July 20, 2019, 8:57 a.m.