Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Group age into age bands #23

Closed terrymclaughlin closed 4 years ago

terrymclaughlin commented 4 years ago

I have a function that I use regularly that takes a vector of numeric values (i.e. people's ages) and groups them into age bands ages based on parameters provided to the function.

I think this would be a function that many of our analysts could make regular use of. Would you be happy for me to contribute this to the package? I'd be happy to receive feedback on the function as well if it can be improved at all.

jvillacampa commented 4 years ago

Hi @terrymclaughlin, I think @chrisdeans is doing something in those lines in the branch get_agegroup. Maybe worth chatting/collaborating with him?

davidc92 commented 4 years ago

Hi @terrymclaughlin, I think @chrisdeans is doing something in those lines in the branch get_agegroup. Maybe worth chatting/collaborating with him?

Yup, @jvillacampa is correct. @chrisdeans has already written some code for this and already created a branch. Might be worth checking in with him.

terrymclaughlin commented 4 years ago

Hi @terrymclaughlin, I think @chrisdeans is doing something in those lines in the branch get_agegroup. Maybe worth chatting/collaborating with him?

Ah, great. I didn't realise @chrisdeans was already working on this. I will speak to him. Thanks!

davidc92 commented 4 years ago

We should keep this open until the branch is merged and the function is live. It will help avoid duplication in the future :)

jackhannah95 commented 4 years ago

Hi @terrymclaughlin and @chrisdeans,

Have you guys discussed this at all? Chris' branch has been open for a while and we'd be keen to incorporate a function of this sort into the package as soon as possible.

chrisdeans commented 4 years ago

Hi @jackhannah95, Terry and I discussed this last month and I added his suggestions to the branch. @RoisinF is checking the code at the moment.

jackhannah95 commented 4 years ago

Ok great 👍 When you're ready to open a PR, I'll do a review as well and merge it in.