I'm doing text analysis using tidytext
. I am trying to calculate the tf-idf for a corpus. The standard way to do this is:
book_words <- book_words %>%
bind_tf_idf(word, book, n)
However, in my case, the 'document' is not defined by a single column (like book
). Is it possible to call bind_tf_idf where the document is defined by two columns (for example, book
and chapter
)?