OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
40 stars 45 forks source link

Error in `covariates$"timeId"` at #1088

Closed gowthamrao closed 8 months ago

gowthamrao commented 8 months ago

https://github.com/OHDSI/CohortDiagnostics/blame/76911f757b9db74f7fe1c4a7e7405d4d285dc622/R/CohortCharacterizationDiagnostics.R#L156-L158

I got an error while running CD.

Error in covariates$"timeId" at CohortDiagnostics/R/CohortCharacterizationDiagnostics.R:114:6: ! The $ method of is for internal use only. i Use dplyr::pull() to get the values in a column.

in debug mode, it was at

(length(is.na(covariates$timeId)) > 0)

I think an Andromeda object (i.e. output of Feature Extraction) does not support this?

gowthamrao commented 8 months ago

The object results$timeRef does not have NA

image

but, covariates does image

base R syntax gives an error on Andromeda object. pulling data out of Andromeda using dplyr::collect() resolves it. However, it takes long time -- and defeats the purpose of Andromeda image

gowthamrao commented 8 months ago

What is bothering me is - this has been working for a long time. timeId is NULL for covariates like following (that are not time dependent). i.e. we had timeId = NA as part of FeatureExtraction output for a long time and this syntax used to handle it.

image

gowthamrao commented 8 months ago

https://github.com/OHDSI/CohortDiagnostics/pull/1091