Richard-Packer / DeepPheWAS

An R package for phenotype generation and association testing for phenome wide associations studies (PheWAS)
GNU General Public License v3.0
10 stars 6 forks source link

"Can't convert <double> to <date>" during concept creation #7

Open mikkmart opened 1 year ago

mikkmart commented 1 year ago

If for any reason the earliest_date of the occurrence of a clinical code is missing for a participant during the concept creation part, the program errors out with the following stack trace:

Error:
! Assigned data `value` must be compatible with existing data.
ℹ Error occurred for column `earliest_date`.
x Can't convert <double> to <date>.

The culprit seems to be this line which tries to assign 0 also to the missing date values:

https://github.com/Richard-Packer/DeepPheWAS/blob/d569e975213e4138d026fffe28ea1f42d6aa15ee/R/concept_creation.R#L203C21-L203C21