# IMPORTANT: these examples must be runnable during R CMD check.
# If `x` is not defined in examples, create a tiny reproducible dataset here.
x <- data.frame(id = c(1, 1, 2), code = c("I10", "E119", "J449"), stringsAsFactors = FALSE)
# Checking the `assign0` argument:
x3 <- data.frame(id = 1, code = c("E100", "E102"), stringsAsFactors = FALSE)
ccF <- comorbidity(x = x3, id = "id", code = "code", map = "charlson_icd10_quan", assign0 = FALSE)
score(x = ccF, assign0 = FALSE)
score(x = ccF, assign0 = TRUE)
Run the code above in your browser using DataLab