浏览代码

change to bar_plot_fractions

genderequality-alternative
JosuaKugler 4 年前
父节点
当前提交
0597f68694
共有 1 个文件被更改,包括 15 次插入3 次删除
  1. +15
    -3
      vignettes/genderequality.Rmd

+ 15
- 3
vignettes/genderequality.Rmd 查看文件

@@ -120,10 +120,24 @@ pie +
ylab("")
```

Next we look at the individual distributions between men and women in relation to the individual parties.
Next we look at the individual distributions between men and women in the different fractions.

```{r}
speaker_with_gender %>%
group_by(fraction) %>%
summarize(n = n()) ->
fraction_size

speaker_with_gender %>%
filter(gender=="female") %>%
group_by(fraction) %>%
summarize(n_female = n()) %>%
left_join(fraction_size) %>%
mutate(q = n_female/n) -> women_per_fraction
bar_plot_fractions(women_per_fraction, x_variable=fraction, y_variable=q, title="Frauenanteil nach Partei")
```

```r
speaker_with_gender %>%
select(fraction, gender) %>%
group_by(fraction, gender) %>%
@@ -174,8 +188,6 @@ pie6 <- bp + coord_polar("y", start=0) + ggtitle("SPD") + xlab("") + ylab("")
gridExtra::grid.arrange(pie1,pie2,pie3,pie4,pie5,pie6,nrow=2)
```



Now let's analyze whether there are any differences in the amount of speeches given.
```{r}



正在加载...
取消
保存