FredHutch / scharpTemplates

An rmarkdown template for VISC.
0 stars 0 forks source link

Come of with consistent list of R options, R chunk options, table/fig options #10

Open wfulp opened 5 years ago

wfulp commented 5 years ago

We need a default list of options (options()), R chunk options (opts_chunk$set()). Currently we have:

opts_chunk$set(tidy = TRUE, cache = FALSE, messages = TRUE, warning = TRUE, echo = FALSE, 
               dev = c("png", "pdf"), dpi = 200, out.width = '100%', out.extra = '')
options(knitr.kable.NA = '')

We also need to make sure any table and figure options are spelled out in template consistently:

mag_tab %>%
  kable(
    format = output_type,
    longtable = FALSE,
    booktabs = TRUE,
    linesep = "",
    escape = FALSE,
    caption = "Table Example"
  ) %>%
  kable_styling(
    font_size = 8,
    latex_options = c("hold_position", "scale_down", "repeat_header")
  ) %>% 
  footnote("BAMA Magnitude with testing", threeparttable = TRUE)
wfulp commented 5 years ago

This is more of a discussion to see if we can get the most complete list possible of options. Please mention any you use so we can build the list.

monicagerber commented 5 years ago

How about fig.pos="H"?

mayerbry commented 5 years ago

We could write some wrapper for visc-formatting in tables, e.g.,

visc_kable = function(x, format = "latex", booktabs = F, ...){
   kable(x, format = format, booktabs = booktabs, ...)
  }