useR!2017 has ended
Back To Schedule
Thursday, July 6 • 5:40pm - 5:45pm
Use of templates within an R package to create a (semi-)automated analysis workflow and/or report

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Keywords: reporting, reproducibility, automation, Rmarkdown
Have you ever had the feeling that the creation of your data analysis report(s) resulted in quite some copy-paste from previous analyses? This copy-pasting is time-consuming and prone to errors.
If you need to analyze frequently quite similar data, e.g. from a standardized workflow or different experiments on a specific platform, automation of your analysis can be a useful and time-saving step.
An efficient solution might be the development of modular template documents integrated in an R ‘template’ package. This package contains the common analysis parts consistent throughout the different analyses, in different child (potentially nested) template documents (module). These templates can be seen as the equivalent of an R function, integrated within an R package, for reporting with input parameters and potentially some default values (necessary/specific analysis parts).
A main ‘master’ template, specific for each analysis (e.g. experiment) can call the child document(s) contained in the package. It is advisable and user-friendly, for yourself and potential other users, to create a start template for this master document, where the required and optional input parameters necessary for the downstream analysis are specified.
For the developers, the use of the R package unity containing all functionalities and part of the workflow can facilitate code exchange and lower the possible errors during code writing. During package use and development you might encounter possible extensions - depending on specific requests of the users - which can be implemented and easily incorporated in previous as well as future reports. Although the development of such an R ‘template’ package might seem time-consuming at first, a lot of time is gained when using this package afterwards and making this effort worthwhile. For the users, reports are consistent across different analyses and appropriate package versioning - to keep track of changes, extensions and bug fixes - ensures the reproducibility of an entire analysis.
The knitr package can be used for the creation and successive integration of child templates.
A shiny app can be created to allow for an user-friendly and easy way of creating reports without need to be familiar to R.
Example of the implementation and the use of such workflow in rmarkdown format will be presented.

Thursday July 6, 2017 5:40pm - 5:45pm CEST
2.02 Wild Gallery