add basic analysing utils

This commit is contained in:
2021-07-28 21:23:06 +02:00
parent d42a039b31
commit 1463f6092e
3 changed files with 27 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
#' @export
find_word <- function(res, word) {
talks <- res$talks
mutate(talks, occurences = sapply(str_match_all(talks$content, regex(word, ignore_case = TRUE)),
nrow))
}
#' @export
join_redner <- function(tb, res, fraktion_only = F) {
joined <- left_join(tb, res$redner, by=c("redner" = "id"))
if (fraktion_only) select(joined, "fraktion")
else joined
}