Description Usage Arguments Value Examples
View source: R/text_dtm_prep.R
Calculate TF-IDF scores and create a Document-Term Matrix from your dataset.
1 | text_dtm_prep(unnest_data, grouping_var, word_col = "word")
|
unnest_data |
dataframe with unnested tokens |
grouping_var |
column used for determining what consistutes a document; with quotation marks (string) If each response is a row, add a column with row identifiers to be the grouping_var. |
word_col |
column name containing the unnested tokens |
List containing the prepared data and a Document-Term Matrix
1 2 | tidytext::unnest_tokens(dummy_response, 'word', colnames(dummy_response)[7]) %>%
text_dtm_prep(., 'response_id')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.