# set chunk defaults knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) set.seed({{format(Sys.Date(), format = "%Y%m%d")}}) knitr::opts_chunk$set(fig.width=8, fig.height=10)
library(biostatR) library(tidyverse) library(captioner) # setting MSK ggplot theme and color palette theme_set(mskRvis::theme_biostat()) mskRvis::set_msk_palette() {{(ifelse(tolower(Sys.info()[["user"]]) %in% eval(as.list(bstfun::theme_gtsummary_msk)$name), glue::glue(" # Set custom gtsummary theme if exists in the bstfun::theme_gtsummary_msk bstfun::theme_gtsummary_msk('{tolower(Sys.info()[['user']])}') "), ""))}} # importing master analytic data set df_master <- readRDS( file = here::here(path_data, "df_master.Rds") ) # Import analysis result objects here load(here::here(path_data,"020-analysis.RData"))
# define complex inline-reporting objects here
## Setting up Table and Fig numberings ------------------ tbl_cap = captioner(prefix = "Table") fig_cap = captioner(prefix = "Figure") ## table captions -------------- tbl_cap("tab_table1", "Patient Characteristics") ## figure captions ------------------------------------ fig_cap("fig_ROCgrade", "Grade ROC") ## To refer to table/fig in the text ------------------------------------ # Function to reference table in text f.ref <- function(x) { stringr::str_extract(tbl_cap(x), "[^:]*") } # example: **`r table_nums("tab_table1", display = "cite")`** # Function to reference figure in text f.ref.fig <- function(x) { stringr::str_extract(fig_cap(x), "[^:]*") } # example: **`r f.ref("fig_ROCgrade")`**
Output generated using the following dataset(s) received r readr::read_lines(here::here("data_date.txt"), n_max = 1)
: ''
We analyzed r n_distinct(df_master$EPISODE_ID)
prostate RO episodes from the RO Episode file (2015-2017) dataset.
The analysis objectives included: TO BE FILLED IN
A significance level of 0.05 was used throughout.
All analyses were conducted using r cite_r(pkgs = c("tidyverse", "gtsummary"), add_citation = TRUE)
.
r tbl_cap('tab_table1')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.