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 identifier for a foreign dictionary, e.g. path to a dictionary in YAML or LIWC format
texts read via keyATM_read()
a quanteda dictionary object, ignore if file is not NULL
boolean, if multi-word terms be seperated, e.g. "air force" splits into "air" and "force".
additional parameters for quanteda::dictionary()
a named list which can be used as keywords for e.g. keyATM()
if (FALSE) {
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")
}