improve vignette

This commit is contained in:
2021-07-28 22:46:17 +02:00
parent e8cf7f0e4b
commit d01cea9d52
3 changed files with 38 additions and 16 deletions
+18
View File
@@ -11,3 +11,21 @@ join_redner <- function(tb, res, fraktion_only = F) {
if (fraktion_only) select(joined, "fraktion")
else joined
}
party_colors <- c(
SPD="#DF0B25",
"CDU/CSU"="#000000",
AfD="#1A9FDD",
"AfD&Fraktionslos"="#1A9FDD",
"DIE LINKE"="#BC3475",
"BÜNDNIS 90 / DIE GRÜNEN"="#4A932B",
FDP="#FEEB34",
Fraktionslos="#FEEB34"
)
#' @export
bar_plot_fraktionen <- function(tb) {
ggplot(tb, aes(x = reorder(fraktion, -n), y = n, fill = fraktion)) +
scale_fill_manual(values = party_colors) +
geom_bar(stat = "identity")
}