Closed shijiaSMH closed 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.
Function to calculate year of
admission_date_time
anddischarge_date_time
, since multiple research protocols have admission year as a covariatesubstring(date-time field,1,4)