forked from rll307/WorkshopTwitter2022_PTBR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10_plotting.R
50 lines (39 loc) · 1.49 KB
/
10_plotting.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
a.tk <- tokens(a.lula_Ciro,
remove_punct = TRUE,
remove_symbols = TRUE,
remove_numbers = TRUE,
verbose = TRUE) %>%
tokens_remove(pattern = stopwords("pt")) %>%
tokens_group(groups = screen_name)
writeLines("It is part of my CNPq-funded project and seeks to make corpus tools and R accessible. If you have any doubts or wish to make any research contact please send me an email. Rodrigo de Lima-Lopes [email protected]")
dfm.a <- dfm(a.tk, verbose = TRUE)
textstat_keyness(dfm.a,
target = "LulaOficial",
measure = "lr") |>
textplot_keyness(n= 25)
# Lula vs JB
b.tk <- tokens(b.lula_JB,
remove_punct = TRUE,
remove_symbols = TRUE,
remove_numbers = TRUE,
verbose = TRUE) %>%
tokens_remove(pattern = stopwords("pt")) %>%
tokens_group(groups = screen_name)
dfm.b <- dfm(b.tk, verbose = TRUE)
textstat_keyness(dfm.b,
target = "LulaOficial",
measure = "lr") |>
textplot_keyness(n= 25)
# Ciro vs JB
c.tk <- tokens(c.ciro_JB,
remove_punct = TRUE,
remove_symbols = TRUE,
remove_numbers = TRUE,
verbose = TRUE) %>%
tokens_remove(pattern = stopwords("pt")) %>%
tokens_group(groups = screen_name)
dfm.c <- dfm(c.tk, verbose = TRUE)
textstat_keyness(dfm.c,
target = "cirogomes",
measure = "lr") |>
textplot_keyness(n= 25)