-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Function: age_at_date
#65
Comments
I'm disinclined to greenlight this when |
I like the idea of a having a function to calculate age, especially using
The second thing I don't like is how units more granular than days aren't supported, but I'm sure this was intentional.
Perhaps we could use something like below which has similar general functionality as Edited to use periods instead of durations.
|
That's quite a nice implementation Nic. @davidc92 I'd say the main reason would be to provide an obvious function to use i.e. "Use the one in phsmethods" whilst eeptools does do what we want I wasn't aware of it before now so I'd guess other people aren't either (seems to be the case from the original Teams thread too). |
As per this chat on Teams, there are numerous possible options for calculating age.
It would be good to have a simple function that takes dob and a date and returns the age in years. I could be wrong but I don't think there's a need for age in months, days or factional years? Definitely, whole years should be the default, if not the only option.
The function would need to be tested against all edge cases (combination of leap year dates etc.) to validate the methodology and tested against existing options for speed. It's possible just a wrapper to simplify an existing function would be the most efficient, e.g.
The text was updated successfully, but these errors were encountered: