comorbid: Helper functions to check strings and get count position

Description Usage Arguments Examples

Description

Convert and check comorbid strings, count positions within them to get disease counts.

Usage

1
2
3
4
5
to_string(comorbid_column)

check_strings_equal(comorbid_column)

get_disease_counts(comorbid_column)

Arguments

comorbid_column

A vector of character strings made up of 0s and 1s, or of factors coercible to character, all should be identical lengths.

Examples

1
2
3
4
5
6
7
8
9
comorbid_column <- c('00010', '01000', '01110', '11101')

comorbid_factors <- as.factor(comorbid_column)

to_string(comorbid_factors) # make into string

check_strings_equal(comorbid_column) # TRUE if strings all same length

get_disease_counts(comorbid_column) # list of counts by position in comorbid string

AJFOWLER/comorbidgroupr documentation built on April 8, 2021, 3:51 a.m.