refactor rede -> speech, redner -> speaker
This commit is contained in:
@@ -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 [%]")
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user