The goal of almagro is to calculate the CODEX index in COPD.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("resplab/almagro")
This is a basic example which calculate the CODEX index, which is used to predict survival and risk of COPD readmission and assess the severity. The individual has Charlson Index (relatinng long-term mortality with the paitent's comorbidity) 1, 65% forced expiratory volume in one second (FEV1), the dyspnea scale of modified Medical Research Council (mMRC) 1, and 2 severe exacerbation of COPD during the precious year. He/she would have CODEX score 1.
library(almagro)
almagro(charlson_index=1, fev=65, mmrc=1, exacerbation=2)
$codex
[1] 1