drop_cuts {TreeMineR} | R Documentation |
Remove cuts from your tree. This is, e.g., useful if you would like to remove certain chapters from the ICD-10 tree used for the analysis as some chapters might be a prior deemed irrelevant for the exposure of interest, e.g., chapter 20 (external causes of death) might not be of interest when comparing two drug exposures.
Description
Remove cuts from your tree. This is, e.g., useful if you would like to remove certain chapters from the ICD-10 tree used for the analysis as some chapters might be a prior deemed irrelevant for the exposure of interest, e.g., chapter 20 (external causes of death) might not be of interest when comparing two drug exposures.
Usage
drop_cuts(tree, cuts, delimiter = "/", return_removed = FALSE)
Arguments
tree |
A dataset with one variable |
cuts |
A character vector of cuts to remove. Please make sure that your string
uniquely identifies the cut that should be removed. Each string is passed
to Regular expression are composed as follows:
|
delimiter |
A character defining the delimiter of different tree levels within your
|
return_removed |
A logical value for indicating whether you would like to get a list of removed cuts returned by the function. |
Value
If return_removed = FALSE
a data.frame with a single variable named
pathString
is returned, which includes the updated tree. If
return_removed = TRUE
a list with two elements is return:
- tree
The updated tree file
- removed
A list of character vectors including the paths that have been removed from the supplied tree. The list is named using the cuts supplied to
cut
.
Examples
drop_cuts(icd_10_se, c("B35-B49", "F41"))