Quanteda.dictionaries
Dictionaries for text analysis
Install / Use
/learn @kbenoit/Quanteda.dictionariesREADME
quanteda.dictionaries
<!-- badges: start --> <!-- badges: end -->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)
## docname Segment WPS WC Sixltr Dic care.virtue care.vice
## 1 1789-Washington 1 66.91304 1539 24.37 4.42 0.58 0.06
## 2 1793-Washington 2 36.75000 147 25.17 5.44 0.00 0.00
## 3 1797-Adams 3 69.81081 2583 24.62 5.23 0.39 0.15
## 4 1801-Jefferson 4 47.09756 1931 20.40 4.40 0.62 0.26
## 5 1805-Jefferson 5 52.88889 2380 22.98 3.95 0.25 0.17
## 6 1809-Madison 6 60.23810 1265 24.82 4.90 0.32 0.16
## fairness.virtue fairness.vice loyalty.virtue loyalty.vice authority.virtue
## 1 0.39 0.19 1.23 0.00 1.04
## 2 0.00 0.00 2.04 0.00 3.40
## 3 0.81 0.08 1.47 0.12 1.32
## 4 1.04 0.05 0.93 0.00 0.73
## 5 0.84 0.08 1.01 0.04 1.13
## 6 0.95 0.08 1.50 0.00 1.19
## authority.vice sanctity.virtue sanctity.vice AllPunc Period Comma Colon SemiC
## 1 0.00 0.84 0.06 7.02 1.49 4.55 0.06 0.52
## 2 0.00 0.00 0.00 8.16 2.72 3.40 0.68 0.00
## 3 0.08 0.66 0.15 10.18 1.28 7.78 0.00 0.70
## 4 0.00 0.78 0.00 10.51 1.92 6.63 0.05 1.19
## 5 0.00 0.42 0.00 9.08 1.72 5.97 0.00 1.09
## 6 0.00 0.55 0.16 6.96 1.66 3.72 0.00 1.26
## QMark Exclam Dash Quote Apostro Parenth OtherP
## 1 0.00 0 0.13 0.13 0.00 0.06 6.76
## 2 0.00 0 0.00 0.00 0.00 0.68 6.80
## 3 0.15 0 0.15 0.04 0.04 0.04 9.95
## 4 0.21 0 0.41 0.10 0.10 0.00 10.10
## 5 0.17 0 0.04 0.08 0.08 0.00 9.03
## 6 0.00 0 0.32 0.00 0.00 0.00 6.64
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.
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
