GEMINI-Medicine / Rgemini

A custom R package that provides a variety of functions to perform data analyses with GEMINI data
https://gemini-medicine.github.io/Rgemini/
Other
3 stars 0 forks source link

Admission year #104

Closed shijiaSMH closed 3 months ago

shijiaSMH commented 3 months ago

Function to calculate year of admission_date_time and discharge_date_time, since multiple research protocols have admission year as a covariate

substring(date-time field,1,4)

loffleraSMH commented 3 months ago

Same as for binarizing gender: I don’t think this function is necessary/useful. As a general rule, if a) it’s only a single line of code and b) the code would only need to be run once in a script, it usually doesn’t make sense to functionalize this. Additionally, if there are already other (more specialized) packages that can handle these scenarios, we don’t need to reinvent the wheel. Why not use lubridate::year()? It’s much more flexible and all our scripts already load the lubridate package anyway, so let’s just use that. I’ll go ahead and close this issue to keep our backlog nice and tidy.