ABSTRACT

This chapter deals with creating a basic R Markdown document and using the same R Markdown template and variables to generate multiple HTML files. With R Markdown, a user can do everything in one place: write, edit, and spellcheck his/her narrative; write and run R code; and add R-generated summaries, tables, and visualizations. R Markdown files have the file extension.Rmd, must start with a particular header format, use a specific syntax when incorporating R code, and use an simpler-than-raw-HTML syntax for text. The chapter shows how to use R Markdown to combine text, R code for analysis, and R-generated visualizations. In addition, it looks at advanced options such as a table of contents, custom CSS and themes, and parameters to use the same template for multiple sets of data. The chapter also presents a brief introduction to the robust and flexible purrr package.