-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_tables
60 lines (56 loc) · 1.63 KB
/
plot_tables
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
52
53
54
55
56
57
58
59
60
library(tidyverse)
library(gt)
library(gapminder)
#transformar em porcentagem
prop$`% do corpus (γ)` <- prop$`% do corpus (γ)` * 100
#Fazer tabela
tabelprop <- prop %>%
gt(groupname_col = "agreg") %>%
tab_header(
title = md("**Tabela 1: Tópicos do STM e Agregação - Proposições**")
) %>%
tab_footnote(
footnote = "Fonte: elaboração própria"
) %>%
summary_rows(
columns = c(`% do corpus (γ)`, `nº de documentos`),
fns = list(label = md("**Total Agregação**") , fn = "sum"),
fmt = NULL,
side = "bottom",
missing_text = "",
formatter = NULL
) %>%
tab_options(
row_group.as_column = TRUE,
summary_row.background.color = "gray95",
row_group.background.color = "#FFEFDB",
)
#tabela proposições
tabelprop %>% gtsave(filename = "tabelprop3.png", vwidth = 1500,
vheight = 4500)
#transformar em porcentagem
decr$`% do corpus (γ)` <- decr$`% do corpus (γ)` * 100
tabeldecr <- decr %>%
gt(groupname_col = "agreg") %>%
tab_header(
title = md("**Tabela 2: Tópicos do STM e Agregação - Decretos**")
) %>%
tab_footnote(
footnote = "Fonte: elaboração própria"
) %>%
summary_rows(
columns = c(`% do corpus (γ)`, `nº de documentos`),
fns = list(label = md("**Total Agregação**") , fn = "sum"),
fmt = NULL,
side = "bottom",
missing_text = "",
formatter = NULL
) %>%
tab_options(
row_group.as_column = TRUE,
summary_row.background.color = "gray95",
row_group.background.color = "#FFEFDB",
)
#salvar tabela decretos
tabeldecr %>% gtsave(filename = "tabeldecr.png", vwidth = 1500,
vheight = 4500)