refactor rede -> speech, redner -> speaker
This commit is contained in:
+4
-4
@@ -6,8 +6,8 @@ find_word <- function(res, word) {
|
||||
}
|
||||
|
||||
#' @export
|
||||
join_redner <- function(tb, res, fraktion_only = F) {
|
||||
joined <- left_join(tb, res$redner, by=c("redner" = "id"))
|
||||
join_speaker <- function(tb, res, fraktion_only = F) {
|
||||
joined <- left_join(tb, res$speaker, by=c("speaker" = "id"))
|
||||
if (fraktion_only) select(joined, "fraktion")
|
||||
else joined
|
||||
}
|
||||
@@ -29,7 +29,7 @@ party_order <- factor(c("Fraktionslos", "AfD&Fraktionslos",
|
||||
"FDP", "AfD", NA_character_))
|
||||
|
||||
#' @export
|
||||
bar_plot_fraktionen <- function(tb,
|
||||
bar_plot_fractions <- function(tb,
|
||||
x_variable = NULL, # default is fraktion
|
||||
y_variable = NULL, # default is n
|
||||
fill = NULL, # default is fraktion
|
||||
@@ -82,7 +82,7 @@ word_usage_by_date <- function(res, patterns, name, tidy=F) {
|
||||
else name <- patterns[[i]]
|
||||
tb <- mutate(tb, {{name}} := str_count(content, patterns[[i]]))
|
||||
}
|
||||
left_join(tb, res$reden, by=c("rede_id" = "id")) %>%
|
||||
left_join(tb, res$speeches, by=c("speech_id" = "id")) %>%
|
||||
group_by(date) %>%
|
||||
summarize(across(where(is.numeric), sum)) %>%
|
||||
arrange(date) -> tb
|
||||
|
||||
Reference in New Issue
Block a user