Learn R Programming

⚠️There's a newer version (0.9.10) of this package.Take me there.

quanteda.textmodels

About

An R package adding text scaling models and classifiers for quanteda. Prior to quanteda v2, many of these were part of that package. Early development was supported by the European Research Council grant ERC-2011-StG 283794-QUANTESS.

For more details, see https://quanteda.io.

How to Install

Once the package is on CRAN (which is it not yet), then you can install it via the normal way from CRAN, using your R GUI or

install.packages("quanteda.textmodels") 

Or for the latest development version:

# devtools package required to install quanteda from Github 
devtools::install_github("quanteda/quanteda.textmodels") 

Because this compiles some C++ and Fortran source code, you will need to have installed the appropriate compilers.

If you are using a Windows platform, this means you will need also to install the Rtools software available from CRAN.

If you are using macOS, you should install the macOS tools, namely the Clang 6.x compiler and the GNU Fortran compiler (as quanteda requires gfortran to build). If you are still getting errors related to gfortran, follow the fixes here.

How to cite

Benoit, Kenneth, Kohei Watanabe, Haiyan Wang, Paul Nulty, Adam Obeng, Stefan Müller, and Akitaka Matsuo. (2018) “quanteda: An R package for the quantitative analysis of textual data”. Journal of Open Source Software. 3(30), 774. https://doi.org/10.21105/joss.00774.

For a BibTeX entry, use the output from citation(package = "quanteda").

Leaving Feedback

If you like quanteda, please consider leaving feedback or a testimonial here.

Contributing

Contributions in the form of feedback, comments, code, and bug reports are most welcome. How to contribute:

Copy Link

Version

Install

install.packages('quanteda.textmodels')

Monthly Downloads

1,485

Version

0.9.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Kenneth Benoit

Last Published

March 13th, 2020

Functions in quanteda.textmodels (0.9.1)

data_corpus_EPcoaldebate

Crowd-labelled sentence corpus from a 2010 EP debate on coal subsidies
friendly_class_undefined_message

Print friendly object class not defined message
influence.predict.textmodel_affinity

Compute feature influence from a predicted textmodel_affinity object
as.summary.textmodel

Assign the summary.textmodel class to a list
data_dfm_lbgexample

dfm from data in Table 1 of Laver, Benoit, and Garry (2003)
predict.textmodel_wordscores

Predict textmodel_wordscores
data_corpus_moviereviews

Movie reviews with polarity from Pang and Lee (2004)
coef.textmodel_ca

Extract model coefficients from a fitted textmodel_ca object
textmodel_affinity

Class affinity maximum likelihood text scaling model
predict.textmodel_svmlin

Prediction from a fitted textmodel_svmlin object
textmodel_wordscores

Wordscores text model
predict.textmodel_nb

Prediction from a fitted textmodel_nb object
textmodels

quanteda.textmodels: Scaling Models and Classifiers for Textual Data
predict.textmodel_svm

Prediction from a fitted textmodel_svm object
message_error

Return an error message
print.textmodel_wordfish

print method for a wordfish model
predict.textmodel_affinity

Prediction for a fitted affinity textmodel
print.coefficients_textmodel

Print methods for textmodel features estimates This is a helper function used in print.summary.textmodel.
force_conformance

Internal function to match a dfm features to a target set
textmodel_affinity-internal

Internal methods for textmodel_affinity
textmodel_ca

Correspondence analysis of a document-feature matrix
summary.textmodel_nb

summary method for textmodel_nb objects
print.statistics_textmodel

Implements print methods for textmodel_statistics
predict.textmodel_wordfish

Prediction from a textmodel_wordfish method
textmodel_wordfish

Wordfish text model
unused_dots

Raise warning of unused dots
summary.textmodel_wordfish

summary method for textmodel_wordfish
textmodel_svmlin

(faster) Linear SVM classifier for texts
summary.textmodel_svm

summary method for textmodel_svm objects
textplot_influence

Influence plot for text scaling models
textmodel_lsa

Latent Semantic Analysis
textmodel_nb

Naive Bayes classifier for texts
textplot_scale1d

Plot a fitted scaling model
textmodel_svm

Linear SVM classifier for texts
print.summary.textmodel

print method for summary.textmodel
summary.textmodel_svmlin

summary method for textmodel_svmlin objects
textmodel_lsa-postestimation

Post-estimations methods for textmodel_lsa
data_corpus_dailnoconf1991

Confidence debate from 1991 Irish Parliament
data_corpus_irishbudget2010

Irish budget speeches from 2010
as.statistics_textmodel

Coerce various objects to statistics_textmodel
affinity

Internal function to fit the likelihood scaling mixture model.
as.matrix.csr.dfm

convert a dfm into a matrix.csr from SparseM package
as.coefficients_textmodel

Coerce various objects to coefficients_textmodel This is a helper function used in summary.textmodel_*.