refactor rede -> speech, redner -> speaker

This commit is contained in:
2021-08-03 17:05:07 +02:00
parent 09f5e5da0d
commit 7315dd8793
6 changed files with 106 additions and 105 deletions
+6 -6
View File
@@ -31,8 +31,8 @@ Second, those `.xml` files, need to be parsed into `R` `tibbles`. This is accomp
```r
read_all("../records/") %>% repair() -> res
reden <- res$reden
redner <- res$redner
speeches <- res$speeches
speaker <- res$speaker
talks <- res$talks
```
We also used `repair` to fix a bunch of formatting issues in the records and unpacked
@@ -43,8 +43,8 @@ For development purposes, we load the tables from csv files.
tables <- read_from_csv('../csv/')
comments <- tables$comments
reden <- tables$reden
redner <- tables$redner
speeches <- tables$speeches
speaker <- tables$speaker
talks <- tables$talks
```
@@ -60,7 +60,7 @@ hitlerwords <- tibble(Worte)
Now we extract the words that were used with higher frequency by one party and compare them with `hitlerwords`.
```{r}
talks %>%
left_join(redner, by=c(redner='id')) %>%
left_join(speaker, by=c(speaker='id')) %>%
group_by(fraktion) %>%
summarize(full_text=str_c(content, collapse="\n")) -> talks_by_fraktion
```
@@ -169,5 +169,5 @@ hitler_comparison
```
Finally, we want to plot our results:
```{r, fig.width=7}
bar_plot_fraktionen(hitler_comparison, y_variable = percent, title="Coincidence of party vocabulary with nazi vocabulary", ylab="unique 'nazi' words per total (unique) fraction words [%]")
bar_plot_fractions(hitler_comparison, y_variable = percent, title="Coincidence of party vocabulary with nazi vocabulary", ylab="unique 'nazi' words per total (unique) fraction words [%]")
```