library(magrittr) library(readxl) library(ggplot2) library(lubridate) library(gridExtra) library(kableExtra) knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, fig.pos='!H') options(qwraps2_markup = 'markdown') # Qwraps2 parameters prec <- 1 #kableExtra table parameters table_fs <- 7 figsize <- 3 total_row_ft <- "gray" total_row_ft2 <- "white" striped_row_bg <- "gray!10" total_row_bg2 <- "gray"
is_india <- Sys.getenv('TIMCI_COUNTRY') == 'India' is_tanzania <- Sys.getenv('TIMCI_COUNTRY') == 'Tanzania' is_kenya <- Sys.getenv('TIMCI_COUNTRY') == 'Kenya' is_senegal <- Sys.getenv('TIMCI_COUNTRY') == 'Senegal' is_rct <- is_tanzania | is_india is_ls <- is_kenya | is_senegal
\fancypagestyle{plain}{\pagestyle{fancy}} \pagestyle{fancy} \fancyhf{} \setlength{\headheight}{32pt} \renewcommand{\headrulewidth}{0pt} \fancyhead[C]{\includegraphics[width=10cm]{banner.png}} \fancyfoot[R]{Page \thepage\ of \pageref{LastPage}} \fancyfoot[L]{TIMCI PM \& T-F Operational Report v1.0}
\setcounter{tocdepth}{2} \tableofcontents
\newpage
r notice_str
r intro_str
if (!is.null(params$facility_data)) { facility_data <- params$facility_data tf_data <- params$tf_data pm_data <- params$pm_data raw_withdrawal_data <- params$raw_withdrawal_data } # Extract personally identifiable data pii <- timci::extract_enrolled_participants(facility_data)[[2]] # Merge facility generic info with facility data facility_data <- merge(facility_data, params$research_facilities[, c("deviceid", "facility_name")], by.x = 'device_id', by.y = 'deviceid', all.x = TRUE)
start_date <- NULL end_date <- NULL if (nrow(tf_data) > 0) { start_date <- min(tf_data$date) end_date <- max(tf_data$date) week_nb <- ceiling(difftime(as.Date(end_date), as.Date(start_date) - 1,units = "weeks")) days_nb <- sum(!lubridate::wday(seq(as.Date(start_date), as.Date(end_date), "days")) %in% c("7", "1")) if (Sys.getenv('TIMCI_COUNTRY') == 'Senegal') { cat(paste0("Ce rapport couvre la période du **", start_date, "** (début de l'étude) au **", end_date, "** pour le **Sénégal**.")) } else { cat(paste0("This report covers the period from **", start_date, "** (study start) to **", end_date, "** for **", Sys.getenv('TIMCI_COUNTRY'), "**.")) } }
pm_is_not_null <- !is.null(pm_data) if (pm_is_not_null) { pm_is_not_null <- length(pm_data) > 0 }
tf_is_not_null <- !is.null(tf_data) if (tf_is_not_null) { tf_is_not_null <- length(tf_data) > 0 }
\newpage \listoftables
\newpage \listoffigures
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.