is_comb_element_of: Is drug combination element of given vector?

Description Usage Arguments Value Examples

View source: R/input.R

Description

Use this function to determine if a drug combination is part of a vector of other drug combinations. We take care only of pair-wise drug combinations and an internal check is done for alternative drug names, e.g. we check if A-B combination is included, but also for B-A.

Usage

1
is_comb_element_of(drug.comb, comb.vector)

Arguments

drug.comb

a string in the form A-B (no spaces between the names and the hyphen '-')

comb.vector

a character vector of drug combinations, each one in the form drugname.1-drugname.2

Value

logical, depending if the drug combination is element of the given vector or not.

Examples

1
2
3
4
5
6
7
# TRUE
is_comb_element_of("A-B", c("E-F", "A-B"))
is_comb_element_of("B-A", c("E-F", "A-B"))

# FALSE
is_comb_element_of("A-B", c("E-F", "A-D"))
is_comb_element_of("A-B", c())

emba documentation built on Jan. 7, 2021, 9:09 a.m.