ccTable_filter_categories: Categorical data filter

ccTable_filter_categoriesR Documentation

Categorical data filter

Description

Categorical variables only allow a set of values to appear in the variable . Due to various reasons, a categorical variable may contain values that are not standard. The allowed values can be set in the YAML configuration while initialising the ccTable (see ccTable-class, create_cctable). In the following example, we can see how to set up the categorical filter for the variable dead_icu (NIHR_HIC_ICU_0097) which only allows its value to be A, D, E.

Examples

## Not run: 
# Example for categorical filter setup in the YAML configuration
NIHR_HIC_ICU_0097:
 category:
   levels:
     A: Alive
     D: Dead
     E: Alive - not discharged
   apply: drop_entry

# Run the filter on ccTable ct
ct$filter_categories() # run the filter
ct$apply_filters()     # apply the filter and create the clean table

## End(Not run)

ropensci/cleanEHR documentation built on Aug. 28, 2022, 8:31 p.m.