-
Notifications
You must be signed in to change notification settings - Fork 13
/
README.Rmd
43 lines (30 loc) · 1.96 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: "quanteda.dictionaries"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
<!-- badges: start -->
[![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)
<!-- badges: end -->
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.