-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.R
52 lines (47 loc) · 1.36 KB
/
setup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
library(data.table)
library(readxl)
library(officer)
library(rmarkdown)
library(officedown)
library(flextable)
library(ggplot2)
library(shiny)
Sys.setlocale("LC_TIME", "Spanish")
knitr::opts_chunk$set(echo = FALSE,message = FALSE, warning = FALSE)
# flextable ----
use_df_printer()
set_flextable_defaults(
border.color = "gray",
fonts_ignore=TRUE,
padding.bottom = 3, padding.top = 3,
padding.left = 4, padding.right = 4,
post_process_html = function(x){
# theme_booktabs(x) |>
theme_vanilla(x) |>
set_table_properties(layout = "autofit") |>
autofit() |>
align(align="center",part = "header") |>
bold(part = "header") |>
fontsize(size = 10, part = "header")|>
fontsize(size = 10, part = "body")
},
post_process_pdf = function(x){
# theme_booktabs(x) |>
theme_vanilla(x) |>
set_table_properties(layout = "autofit") |>
autofit() |>
align(align="center",part = "header") |>
bold(part = "header") |>
fontsize(size = 9, part = "header")|>
fontsize(size = 9, part = "body")
},
post_process_docx = function(x){
theme_vanilla(x) |>
set_table_properties(layout = "autofit") |>
autofit() |>
align(align="center",part = "header") |>
bold(part = "header") |>
fontsize(size = 10, part = "header")|>
fontsize(size = 9, part = "body")
}
)