# NOT RUN {
mydf <- data.frame(
visit_name = c("a", "b", "c"),
icd9 = c("412.93", "441", "042")
)
van_walraven(mydf)
# or calculate comorbodities first:
cmb <- icd9_comorbid_quan_elix(mydf, short_code = FALSE, hierarchy = TRUE)
vwr <- van_walraven_from_comorbid(cmb)
stopifnot(identical(van_walraven(mydf), vwr))
# alternatively return as data frame in 'tidy' format
van_walraven(mydf, return_df = TRUE)
# }
Run the code above in your browser using DataLab