ns-rse / sheffield-thyroid

http://blog.nshephard.dev/sheffield-thyroid/
GNU General Public License v3.0
0 stars 0 forks source link

Using purrr on imputed datasets #38

Closed ns-rse closed 1 month ago

ns-rse commented 1 month ago

Initial attempt to define recipes for imputed data sets using purrr.

As mentioned I thought about this and think there is a better approach, this is my first attempt at doing so.

The file sections/_recipe_imputed.qmd is included which wraps all the steps in sections/_recipe.qmd in purrr::map() calls which are applied to the mice_cart$imputed data set (which has had Original data set removed, the .id variable stripped and the data split based on .imp).

Its not quite there yet but I think this is the proper way to approach using purrr rather than writing one big function to do everything (which whilst possible would be more challenging for you to undertake @mdp21oe).

I've left some notes in sections/_recipe_imputed.qmd, look for !!!!!!. The first I have copied here as its important...

I'm new to using purrr but from what I can work out/understand so far and the way we want to use it we start with a dataset that is piped into purrr::map() the first thing we do is then define how we will refer to this dataset using the notation \(<some_name>) we then provide a function we wish to apply to each split of the data and use <some_name> as an argument to that function.

mdp21oe commented 1 month ago

Excellent will start looking into this