knitr::opts_chunk$set(echo = TRUE)
An R package consisting of dictionaries for text analysis and associated utilities. Designed to be used with quanteda but can be used more generally with any text analytic package (e.g. tidytext, tm, etc.).
# the devtools package needs to be installed for this to work devtools::install_github("kbenoit/quanteda.dictionaries")
With the liwcalike()
function from the quanteda.dictionaries package, you can easily analyse text corpora using existing or custom dictionaries. Here we show how to apply the Moral Foundations Dictionary to the US Presidential Inaugural speech corpus distributed with quanteda.
library("quanteda") library("quanteda.dictionaries") output_lsd <- liwcalike(data_corpus_inaugural, dictionary = data_dictionary_MFD) head(output_lsd)
More dictionaries are supplied with the quanteda.sentiment package.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.