# Suggested set-up options
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, 
                      results = "asis", fig.align = "center", fig.pos = "H",
                      # The figure file path is relative to the location of this
                      # Rmd file, not the working directory.
                      fig.path = "../../Outputs/Figures/", dev = "png", 
                      dpi = 300, fig.asp = 0.8, fig.width = 6, out.width = "80%",
                      fig.process = function(path) {
                        newpath <- stringr::str_remove(path, pattern = "-1")
                        fs::file_move(path = path, new_path = newpath)
                        ifelse(fs::file_exists(newpath), newpath, path)
                      })

# Default options for the xtable package
options(xtable.include.rownames = FALSE, xtable.comment = FALSE,
        xtable.caption.placement = "top", 
        xtable.sanitize.text.function = sanitise_percent,
        xtable.latex.environments = "",
        xtable.table.placement = "H")

# Update this to set your theme for graphs for the whole report
theme_set(theme_bw(base_size = 12))

# If saving tables created in this report to excel then set up the workbook here
# (requires openxlsx)
tables <- createWorkbook()

Statistics Report Template

This template is designed to create a reproducible report, for use at Sheffield CTRU. It uses LaTeX to produce a pdf report and familiarity with LaTeX is essential for its use.

It is recommended that reading in the data, data wrangling and analyses take place in R scripts outside of this report and that this report is rendered using rmarkdown::render() rather than the knit button.



EstherHerbert/Useful.functions documentation built on Jan. 31, 2025, 10:41 a.m.