knitr::opts_chunk$set(echo = TRUE)

CRAN status Coverage Status R-CMD-check

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.).

Installing

# the devtools package needs to be installed for this to work
devtools::install_github("kbenoit/quanteda.dictionaries") 

Demonstration

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

More dictionaries are supplied with the quanteda.sentiment package.

Code of Conduct

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.



kbenoit/quanteda.dictionaries documentation built on Feb. 9, 2023, 3:28 p.m.