Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kbenoit/quanteda.dictionaries

Dictionaries for text analysis
https://github.com/kbenoit/quanteda.dictionaries

Last synced: about 1 month ago
JSON representation

Dictionaries for text analysis

Awesome Lists containing this project

README

        

---
title: "quanteda.dictionaries"
output: github_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

[![CRAN status](https://www.r-pkg.org/badges/version/quanteda.dictionaries)](https://CRAN.R-project.org/package=quanteda.dictionaries)
[![Coverage Status](https://img.shields.io/codecov/c/github/kbenoit/quanteda.dictionaries/master.svg)](https://codecov.io/github/kbenoit/quanteda.dictionaries?branch=master)
[![R-CMD-check](https://github.com/kbenoit/quanteda.dictionaries/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kbenoit/quanteda.dictionaries/actions/workflows/R-CMD-check.yaml)

An R package consisting of dictionaries for text analysis and associated utilities. Designed to be used with [**quanteda**](http://quanteda.io) but can be used more generally with any text analytic package (e.g. **tidytext**, **tm**, etc.).

## Installing

```{r eval = FALSE}
# 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**](https://github.com/quanteda/quanteda).

```{r, warning=FALSE, message=FALSE}
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**](https://github.com/quanteda/quanteda.sentiment) package.

## Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/kbenoit/quanteda.dictionaries/blob/master/CONDUCT.md). By participating in this project you agree to abide by its terms.