create a categorical variable from categorical input
1 2 3 | ## S3 method for class 'cat_categorical'
categorical(x = logical(), levels = NULL,
alternatives = NULL, alternatives_internal = NULL, class = c())
|
x |
a categorical vector |
levels |
list of possible values for x; similar to factor levels |
alternatives |
a named list of vectors with alternative values corresponding to 'levels'. Must have the same length as levels. Can be accessed with |
alternatives_internal |
a named list of vectors with alternative values corresponding to 'levels'. Must have the same length as levels. Can be accessed with |
class |
optional: name the subclass if you are using this to define a new vector type on top of the 'cat_categorical' class |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.