split_stem: Process disease stems

Description Usage Arguments Value Examples

View source: R/split_stem.R

Description

Cut disease stems for different number of diseases.

Usage

1
split_stem(stems, cut_level = 1, maximal = TRUE)

Arguments

stems

character vector of stems to be processed which should each be separated by a semi-colon (;).

cut_level

number indicating the level at which stems should be cut (i.e. the number of diagnoses).

maximal

A logical that true if the 'maximal' stem is to be considered for each record, or if it is to be limited to only records with the same number of diagnoses as cut_level, default of TRUE.

Value

A vector of the stems cut at the correct number of diagnoses.

Examples

1
2
3
stems <- c('4;5-6;3-5-6;;', '4;5-4;;;', '5;5-6;3-5-6;3-5-6-7;')

split_stem(stems, cut_level = 3, maximal = TRUE)

AJFOWLER/comorbidgroupr documentation built on May 11, 2021, 6:01 a.m.