remove funwithdata, add some text, improve some fig heights
This commit is contained in:
@@ -32,26 +32,18 @@ Second, those `.xml` files, need to be parsed into `R` `tibbles`. This is accomp
|
||||
```r
|
||||
read_all("../inst/records/") %>% repair() -> res
|
||||
```
|
||||
We also used `repair` to fix a bunch of formatting issues in the records and unpacked
|
||||
the result into more descriptive variables.
|
||||
We also used `repair` to fix a bunch of formatting issues in the records.
|
||||
|
||||
For development purposes, we load the tables from csv files.
|
||||
```{r}
|
||||
res <- read_from_csv('../inst/csv/')
|
||||
```
|
||||
and unpack our tibbles
|
||||
```{r}
|
||||
comments <- res$comments
|
||||
speeches <- res$speeches
|
||||
speaker <- res$speaker
|
||||
talks <- res$talks
|
||||
```
|
||||
|
||||
## Analysis
|
||||
|
||||
Now we can start analysing our parsed dataset:
|
||||
|
||||
### Which partie gives the most talkes?
|
||||
### Which party gives the most talks?
|
||||
|
||||
```{r, fig.width=7}
|
||||
join_speaker(res$speeches, res) %>%
|
||||
@@ -59,9 +51,11 @@ join_speaker(res$speeches, res) %>%
|
||||
summarize(n = n()) %>%
|
||||
arrange(n) %>%
|
||||
bar_plot_fractions(title="Number of speeches given by fraction",
|
||||
ylab="Number of speeches")
|
||||
ylab="Number of speeches")
|
||||
```
|
||||
|
||||
Note that `NA` signifies speeches given by speakers who are not members of parliament.
|
||||
|
||||
### Who gives the most speeches?
|
||||
|
||||
```{r}
|
||||
@@ -75,6 +69,8 @@ res$speeches %>%
|
||||
|
||||
### Who talks the longest?
|
||||
|
||||
Calculate the average character length of talks given by speakers:
|
||||
|
||||
```{r}
|
||||
res$talks %>%
|
||||
mutate(content_len = str_length(content)) %>%
|
||||
|
||||
Reference in New Issue
Block a user