steno-aarhus / legliv

UK Biobank Project
0 stars 0 forks source link

refactor: use functionals to really simplify model tidying code #7

Closed lwjohnst86 closed 3 months ago

lwjohnst86 commented 3 months ago

@steno-aarhus/ukbiobank-team Pinging for those interested in learning from another code-review.

This is a PR stacked on #5.

Instead of all the copy and pasting, you can use a functional like imap() (see the help for it to learn more about it), which takes a list of model objects and tidies each of them up.

Instead of a script that is >100 lines of code, you can really simplify code down by pairing a custom function (in this case tidy_model()) with a functional like imap().