## Not run:
# # using magrittr is beautiful:
# library("magrittr", quietly = TRUE, warn.conflicts = FALSE)
# myData <- data.frame(
# visitId = c("v1", "v2", "v3", "v4"),
# diag = c("39891", "39790", "41791", "4401"),
# poa = c("Y", "N", NA, "Y"),
# stringsAsFactors = FALSE
# )
# myData %>% icd9FilterPoaNotNo() %>% icd9ComorbidAhrq
# # can fill out named fields also:
# myData %>% icd9FilterPoaYes(poaField="poa") %>%
# icd9ComorbidAhrq(icd9Field = "diag", visitId = "visitId", isShort = TRUE)
# # can call the core icd9Comorbid function with an arbitrary mapping
# myData %>%
# icd9FilterPoaYes() %>%
# icd9Comorbid(icd9Field = "diag", visitId = "visitId",
# icd9Mapping = quanElixComorbid,
# isShortMapping = TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab