create a new categorical variable
1 2 3 | new_categorical(x = logical(), levels,
alternatives_internal = empty_alternatives(levels),
alternatives = empty_alternatives(levels), class = c())
|
x |
a logical matrix indicating which levels are selected per record (each row is a record, each column corresponds to a level specified in 'level's) |
levels |
list of possible values for x; similar to factor levels |
alternatives_internal |
a named list of vectors with alternative values corresponding to 'levels'. Must have the same length as levels. Can be accessed with |
alternatives |
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.