Description Usage Arguments Value
Prepare news data
1 2 | prepare_news(d, doc_col, date_col, text_cols, docvars = NULL,
first_n_words = NA, with_geo = T, rm_time = T)
|
d |
A data.frame in which each row is a news article. |
doc_col |
The name of the column with unique article ids |
date_col |
The name of the column with the date, in a format that can be coerced to a Date object with as.Date() |
text_cols |
The name(s) of the column(s) with article text. e.g. c('headline','byline','body') |
docvars |
The columns to include as docvars (article meta such as headline, url) |
first_n_words |
Optionally, only include the first n words of the article text in the DTM |
with_geo |
IF TRUE, add geo tags to docvars (see vignette for usage) |
rm_time |
If TRUE, remove time related terms, such as monday, januari and yesterday. |
A quanteda style DTM
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.