Created
September 5, 2017 14:52
-
-
Save shanmdphd/80c685cc6f08e4b57fe1fc138f301aee to your computer and use it in GitHub Desktop.
My favorite reporters setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ReporteRs) | |
options('ReporteRs-fontsize' = 10) | |
potsub <- function(char) pot(char, textProperties(vertical.align = 'subscript')) | |
potsuper <- function(char) pot(char, textProperties(vertical.align = 'superscript')) | |
flexThis <- function(df){ | |
df %>% | |
FlexTable(header.columns = TRUE) %>% | |
setFlexTableBorders(inner.vertical = mystyle$no, inner.horizontal = mystyle$std, | |
outer.vertical = mystyle$no, outer.horizontal = mystyle$big) | |
} | |
mystyle <- list() | |
# Style | |
mystyle$no <- borderProperties( width = 0 ) | |
mystyle$big <- borderProperties( width = 2 ) | |
mystyle$std <- borderProperties( width = 1 ) | |
mystyle$another <- borderProperties(width = 2, color = 'red', style = 'dashed') | |
mystyle$right3 <- parProperties( text.align = 'right', padding = 3 ) | |
mystyle$bottom5 <- cellProperties(padding.top = 10, vertical.align = 'bottom') | |
mystyle$subscript <- textProperties(vertical.align = 'subscript') | |
# PK parameters | |
mystyle$AUClast <- 'AUC' + pot('last', mystyle$subscript) + ' (ng·h/mL)' | |
mystyle$AUCinf <- 'AUC' + pot('inf', mystyle$subscript) + ' (ng·h/mL)' | |
mystyle$Cmax <- 'C' + pot('max', mystyle$subscript) + ' (ng/mL)' | |
mystyle$CLR <- 'CL' + pot('R', mystyle$subscript) + ' (L/h)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment