refactor fraktion -> fraction

This commit is contained in:
2021-08-03 17:11:11 +02:00
parent 7315dd8793
commit a0df02dbed
6 changed files with 85 additions and 85 deletions
+6 -6
View File
@@ -6,9 +6,9 @@ find_word <- function(res, word) {
}
#' @export
join_speaker <- function(tb, res, fraktion_only = F) {
join_speaker <- function(tb, res, fraction_only = F) {
joined <- left_join(tb, res$speaker, by=c("speaker" = "id"))
if (fraktion_only) select(joined, "fraktion")
if (fraction_only) select(joined, "fraction")
else joined
}
@@ -30,9 +30,9 @@ party_order <- factor(c("Fraktionslos", "AfD&Fraktionslos",
#' @export
bar_plot_fractions <- function(tb,
x_variable = NULL, # default is fraktion
x_variable = NULL, # default is fraction
y_variable = NULL, # default is n
fill = NULL, # default is fraktion
fill = NULL, # default is fraction
title = NULL,
xlab = "Fraction",
ylab = "n",
@@ -46,9 +46,9 @@ bar_plot_fractions <- function(tb,
x_variable <- enexpr(x_variable)
# set default values
if (is.null(fill)) fill <- expr(fraktion)
if (is.null(fill)) fill <- expr(fraction)
if (is.null(y_variable)) y_variable <- expr(n)
if (is.null(x_variable)) x_variable <- expr(fraktion)
if (is.null(x_variable)) x_variable <- expr(fraction)
# either reorder fraction factor by variable value
if (reorder) maps <- aes(x = reorder(!!x_variable, -!!y_variable),