| is_discrete | R Documentation |
Whether or not a vector is a discrete variable, returns a logical. Typically used on the Y variable of a model.
is_discrete(x, na.rm = TRUE)
x |
A vector to check the discreteness of. |
na.rm |
Whether or not to remove NA values before testing discreteness. Defaults to TRUE. |
Logical, whether or not x is a discrete variable.
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()
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.