Learn R Programming

emcAdr (version 1.2)

ATCtoNumeric: Convert ATC Code for each patients to the corresponding DFS number of the ATC tree

Description

Convert ATC Code for each patients to the corresponding DFS number of the ATC tree

Usage

ATCtoNumeric(patientATC, tree)

Value

a matrix of the same size as patientATC but containing integer that are the index of the corresponding ATC code.

Arguments

patientATC

: patients observations, for each patient we got a string containing taken medications (ATC code)

tree

: ATC tree (we assume that there is a column 'ATCCode' )

Examples

Run this code
 ATC_code <- c('A01AA30 A01AB03', 'A10AC30')
 ATCtoNumeric(ATC_code, ATC_Tree_UpperBound_2024)

Run the code above in your browser using DataLab