is_category | R Documentation |
Tests if the input object is a valid dataset. This function mainly helps validate input within other functions of the package but could be used to check if a dataset is valid.
Test if vector object is a categorical variable, typically a column in a data frame. This function mainly helps validate input within other functions of the package.
is_category(x, threshold = NULL)
x |
object to be coerced. |
threshold |
Optional. The function returns TRUE if the number of unique values in the input vector is lower. |
A logical.
{
library(dplyr)
iris %>% summarise(across(everything(), is_category))
is_category(iris[['Species']])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.