Learn R Programming

emcAdr (version 1.2)

string_list_to_int_cocktails: Function used to convert a string vector of drugs in form "drug1:drug2" to a vector of index of the ATC tree ex: c(ATC_index(drug1), ATC_index(drugs2))

Description

Function used to convert a string vector of drugs in form "drug1:drug2" to a vector of index of the ATC tree ex: c(ATC_index(drug1), ATC_index(drugs2))

Usage

string_list_to_int_cocktails(ATC_name, lines)

Value

An R List that can be used by other algorithms (e.g. clustering algorithm)

Arguments

ATC_name

the ATC_name column of the ATC tree

lines

A string vector of drugs cocktail in the form "drug1:drug2:...:drug_n"

Examples

Run this code
# \donttest{
  data("ATC_Tree_UpperBound_2024")
  string_list = c('hmg coa reductase inhibitors:nervous system',
                  'metformin:prasugrel')
  string_list_to_int_cocktails(ATC_Tree_UpperBound_2024$Name,
                              string_list)
# }

Run the code above in your browser using DataLab