add check for valid structure of tables
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#'
|
||||
#' @export
|
||||
find_word <- function(res, word) {
|
||||
is_valid_res(res)
|
||||
talks <- res$talks
|
||||
mutate(
|
||||
talks,
|
||||
@@ -28,6 +29,7 @@ find_word <- function(res, word) {
|
||||
#'
|
||||
#' @export
|
||||
join_speaker <- function(tb, res, fraction_only = F) {
|
||||
is_valid_res(res)
|
||||
joined <- left_join(tb, res$speaker, by=c("speaker" = "id"))
|
||||
if (fraction_only) select(joined, "fraction")
|
||||
else joined
|
||||
@@ -145,6 +147,7 @@ bar_plot_fractions <- function(tb,
|
||||
#'
|
||||
#' @export
|
||||
word_usage_by_date <- function(res, patterns, tidy=F) {
|
||||
is_valid_res(res)
|
||||
tb <- res$talks
|
||||
nms <- names(patterns)
|
||||
for (i in seq_along(patterns)) {
|
||||
|
||||
Reference in New Issue
Block a user