read_keywords | R Documentation |
This function converts or reads a dictionary object from quanteda to a named list. "Glob"-style wildcard expressions (e.g. politic*) are resolved based on the available terms in your texts.
read_keywords(file = NULL, docs = NULL, dictionary = NULL, split = TRUE, ...)
file |
file identifier for a foreign dictionary, e.g. path to a dictionary in YAML or LIWC format |
docs |
texts read via |
dictionary |
a quanteda dictionary object, ignore if file is not NULL |
split |
boolean, if multi-word terms be seperated, e.g. "air force" splits into "air" and "force". |
... |
additional parameters for |
a named list which can be used as keywords for e.g. keyATM()
dictionary
## Not run:
library(keyATM)
library(quanteda)
## using the moral foundation dictionary example from quanteda
dictfile <- tempfile()
download.file("http://bit.ly/37cV95h", dictfile)
data(keyATM_data_bills)
bills_dfm <- keyATM_data_bills$doc_dfm
keyATM_docs <- keyATM_read(bills_dfm)
read_keywords(file = dictfile, docs = keyATM_docs, format = "LIWC")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.