categorical.cat_categorical: create a categorical variable from categorical input

Description Usage Arguments

View source: R/00-00-cat.R

Description

create a categorical variable from categorical input

Usage

1
2
3
## S3 method for class 'cat_categorical'
categorical(x = logical(), levels = NULL,
  alternatives = NULL, alternatives_internal = NULL, class = c())

Arguments

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 alternate.

alternatives_internal

a named list of vectors with alternative values corresponding to 'levels'. Must have the same length as levels. Can be accessed with alternate. "internal" alternatives are used to store 'fixed' alternatives for classes extending 'cat_categorical'.

class

optional: name the subclass if you are using this to define a new vector type on top of the 'cat_categorical' class


mabafaba/categorical documentation built on May 3, 2020, 9 p.m.