kable(voterData %>%
group_by(region) %>%
filter(!is.na(region)) %>%
summarize(avg_ft_muslim = mean(ft_muslim_2017, na.rm = TRUE), avg_ft_jew = mean(ft_jew_2017, na.rm = TRUE), avg_ft_christ = mean(ft_christ_2017, na.rm = TRUE))
)
| region | avg_ft_muslim | avg_ft_jew | avg_ft_christ |
|---|---|---|---|
| Midwest | 51.06473 | 76.71033 | 72.56854 |
| Northwest | 51.08774 | 75.50491 | 71.77423 |
| Not in the US | 56.02941 | 75.48571 | 75.34286 |
| South | 47.03671 | 76.79067 | 74.44022 |
| West | 51.81668 | 77.80733 | 67.98046 |
voterData %>%
filter(!is.na(ft_muslim_2017), !is.na(region)) %>%
ggplot() + geom_histogram(aes(x = ft_muslim_2017, fill = region), binwidth = 5) + ggtitle("Feelings Toward Muslims") + facet_wrap(~region) + theme(legend.position = "none")
voterData %>%
filter(!is.na(ft_jew_2017), !is.na(region)) %>%
ggplot() + geom_histogram(aes(x = ft_jew_2017, fill = region), binwidth = 5) + ggtitle("Feelings Toward Jews") + facet_wrap(~region) + theme(legend.position = "none")
voterData %>%
filter(!is.na(ft_christ_2017), !is.na(region)) %>%
ggplot() + geom_histogram(aes(x = ft_christ_2017, fill = region), binwidth = 5) + ggtitle("Feelings Toward Christians") + facet_wrap(~region) + theme(legend.position = "none")