Skip to content

Instantly share code, notes, and snippets.

@shanmdphd
Created September 5, 2017 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanmdphd/80c685cc6f08e4b57fe1fc138f301aee to your computer and use it in GitHub Desktop.
Save shanmdphd/80c685cc6f08e4b57fe1fc138f301aee to your computer and use it in GitHub Desktop.
My favorite reporters setting
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