knitr::opts_chunk$set(echo = TRUE) set.seed({{format(Sys.Date(), format = "%Y%m%d")}})
library(biostatR) library(tidyverse) library(labelled) library(lubridate) library(glue) # Set custom gtsummary theme if exists in the bstfun::theme_gtsummary_msk bstfun::theme_gtsummary_msk('leej22') # Location of data options(path_data = "") # example code for importing excel file raw_dat <- readxl::read_excel( path = paste( bstfun::path_data(data_folder_name = "data"), "raw.xlsx", sep = "/" ) ) %>% janitor::clean_names(case = "all_caps") %>% # uppercase col names mutate(across(where(lubridate::is.POSIXt), lubridate::as_date)) %>%# use lubridates # convert all character/string fields to all upper case mutate_if(is.character, toupper) %>% mutate_if(is.character, trimws, which = "both", whitespace = "[\\h\\v]") # get rid of whitespace
# applying variable labels, and dropping raw variables df_main <- df_main %>% labelled::set_variable_labels( mrn = "Patient MRN" ) # saving master analytic data set saveRDS( object = df_main, file = bstfun::path_data("dat.Rds", data_folder_name = "data") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.