nhs-r-community / demos-and-how-tos

A repo for community contributed demos and how-tos to get common stuff done in the R language
https://nhs-r-community.github.io/demos-and-how-tos/
MIT License
29 stars 13 forks source link

Additional procedural generation of markdown reports #23

Closed JonMinton closed 2 years ago

JonMinton commented 2 years ago

I was going to contribute a short example of procedurally generating markdown reports using params, but see this is already covered quite well.

The issue is whether the scripts I have add anything of sufficient additional value to the extant examples to be worth incorporating. I'm happy with any decision regarding this, including just closing the issue.

The materials are here; a subfolder 'outputs' would have to be added for the reports, but other than that (and ensuring the packages are loaded) it should run as is.

I think the .R + .rmd files add the following to the examples already in the repo:

  1. The construction of a function for calling the markdown template document, which is set up as per the render_one function example in the rmarkdown cookbook chapter on parameterised reports.
  2. The use of the walk function to 'loop' using tidyverse functional programming conventions, in addition to the more intuitive for loop pattern.

If the above provides enough added value I'm happy for the code in part or in entirety to be added (with attribution) to the relevant section of the repo.

ChrisBeeley commented 2 years ago

I think more examples of something is often helpful, so I think this would be great, thanks. You're very welcome to add with attribution, but do please note that the repo is MIT so any code you submit will itself become MIT. Thanks :pray:

JonMinton commented 2 years ago

I've turned it into a PR