Thursday, February 23
PS1 Poster Session 1 and Opening Mixer Thu, Feb 23, 5:30 PM - 7:00 PM
Conference Center AB

Creating Reproducible Tables in R Markdown (303441)

*Claire Palmer, University of Colorado at Denver School of Medicine 

Keywords: R, analysis reports, r markdown, user-defined functions

The applied statistician often finds themselves at the cumbersome juncture of results within an analysis program and a final report that can be shared with non-statistician colleagues. The kable function in R markdown allows for the transfer of code to a table in word document format. Using this, and my own user-defined functions, I go through how one can seamlessly transition from input data to code to final report. I present a general template of a function that can be used with a single input variable and how it can be used in the case of multiple variables. I have generated additional functions to provide final structure to the table before it is passed through the kable function. I use an example of a traditional Table 1 that summarizes demographic and clinical characteristics of subjects in a healthcare research study. The structured code presented provides an invaluable program template to the applied statistician who wishes to generate final analysis reports that are easily reproduced.