У меня возникли некоторые проблемы с пакетом «comorbidity» с тех пор, как обновили R до версии 3.6.1 и RStudio до версии 1.2.5001.
Я хотел бы рассчитать индекс сопряженности Чарльсона (CCI)) по идентификатору, но после обновления RI постоянно появляется следующее предупреждение:
#Create data frame
df <- data.frame(
"ID" = c("A","A","A","A","B","B","B","C","C","C","C"),
"ICD10" = c("A41.9","G92","K52.9","N30.00","N20.0","R10.9","Z95.5","E78.5","I63.9","R47.81","Z87.891"),
"NumEncounters" = rep(1, times = 11)
)
#Calculate CCI
ccm_test <- comorbidity(x=df, id="ID", code="ICD10", score="charlson", icd = "icd10",
assign0=TRUE, tidy.codes=TRUE)
#Warning message appears
Aggregate function missing, defaulting to 'length'
Warning messages:
1: In data.table::melt(loc, value.name = code) :
The melt generic in data.table has been passed a list and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(loc). In the next version, this warning will become an error.
2: In `[.data.table`(merge(x, loc, all.x = TRUE, allow.cartesian = TRUE), :
Column 'code' does not exist to remove
Теперь вывод представляет собой одну строку с агрегированным CCI для всех моих идентификаторов. Как я могу вернуть свой код к нормальной работе, как это было до обновлений?