You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following some e-mail feedback, I think it would be good to add to the package the following functions:
comorbidity_check() (or some similar name) to verify if a user-supplied comorbidity dataset is compatible with the package;
set_comorbidity() (or similar) to add the required internal structure/attributes to yield a comorbidity-compatible object.
Example code using the current (2022-08-16) dev version:
library(comorbidity)
#> This is {comorbidity} version 1.0.3.#> A lot has changed since the pre-1.0.0 release on CRAN, please check-out breaking changes here:#> -> https://ellessenne.github.io/comorbidity/articles/C-changes.htmldf<-data.frame(
id=1,
mi=1,
chf=0,
pvd=0,
cevd=0,
dementia=0,
cpd=0,
rheumd=0,
pud=0,
mld=0,
diab=0,
diabwc=1,
hp=1,
rend=0,
canc=0,
msld=0,
metacanc=0,
aids=0
)
score(x=df)
#> Error: This function can only be used on an object of class 'comorbidity', which you can obtain by using the 'comorbidity()' function. See ?comorbidity for more details.
class(df) <- c("comorbidity", class(df))
attr(df, "map") <-"charlson_icd10_quan"
score(x=df, assign0=FALSE)
#> [1] 3#> attr(,"map")#> [1] "charlson_icd10_quan"
score(x=df, weights="quan", assign0=FALSE)
#> [1] 3#> attr(,"map")#> [1] "charlson_icd10_quan"#> attr(,"weights")#> [1] "quan"df$mi<-NULL
score(x=df, assign0=FALSE)
#> Error in `[.data.frame`(x, , names(.maps[[map]])): undefined columns selected
Following some e-mail feedback, I think it would be good to add to the package the following functions:
comorbidity_check()
(or some similar name) to verify if a user-supplied comorbidity dataset is compatible with the package;set_comorbidity()
(or similar) to add the required internal structure/attributes to yield a comorbidity-compatible object.Example code using the current (2022-08-16) dev version:
Created on 2022-08-16 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: