is_discrete {cheem}R Documentation

Check if a vector is discrete

Description

Whether or not a vector is a discrete variable, returns a logical. Typically used on the Y variable of a model.

Usage

is_discrete(x, na.rm = TRUE)

Arguments

x

A vector to check the discreteness of.

na.rm

Whether or not to remove NA values before testing discreteness. Defaults to TRUE.

Value

Logical, whether or not x is a discrete variable.

See Also

Other cheem utility: as_logical_index(), color_scale_of(), contains_nonnumeric(), is_diverging(), linear_tform(), logistic_tform(), problem_type(), rnorm_from(), sug_basis(), sug_manip_var()

Examples

library(cheem)

is_discrete(mtcars$mpg) ## Numeric column, with more than 25 unique values.
is_discrete(mtcars$cyl) ## Numeric column, labeled as discrete, because less than 25 unique values
is_discrete(letters)    ## Characters and factors labeled discrete.

[Package cheem version 0.4.0.0 Index]