Skip to content

quanteda

4.5.1Package record

Quantitative Analysis of Textual Data

43packages dependsuggested by 17
236.5Kdownloads / year
96.8%test coverage
11/13flavors OK

Overview

About
Maintained by Kenneth BenoitCRAN page ↗GitHub ↗Website ↗Issues ↗Declared funder: European Research Council

A fast, flexible, and comprehensive framework for quantitative text analysis in R. Provides functionality for corpus management, creating and manipulating tokens and n-grams, exploring keywords in context, forming and manipulating sparse matrices of documents by features and feature co-occurrences, analyzing keywords, computing feature similarities and distances, applying content dictionaries, applying supervised and unsupervised machine learning, visually representing text and text analyses, and more.

Changes in 4.5.1

Bug fixes

  • Fixed tests that failed under tm 0.7-20, which no longer attaches the **NLP** package, causing CRAN check errors on r-devel.
  • Fixed a bug in tokens() when the object's concatenator is an empty character.
  • Fixed a bug to create a redundant copy of tokens_xptr when dfm is constructed.

Changes and additions

  • Verbose messages from corpus, tokens, dfm and fcm methods now summarise the object returned, in the form "Returning tokens of 5,394 documents (55,866 tokens, 1,000 types) from tokens_trim()", instead of comparing counts before and after the operation. fcm_select(), fcm_keep() and fcm_remove() now report on the fcm they return, not on an intermediate dfm. (#2016, #2518)
  • The summary line printed by print() for corpus, tokens, dfm and fcm objects now has a common format, e.g. "tokens of 9 documents (6,855 tokens, 1,812 types)." It replaces "Corpus consisting of", "Tokens consisting of", "Document-feature matrix of:" and "Feature co-occurrence matrix of:", and adds the number of characters (corpus), tokens and types (tokens), occurrences (dfm), and co-occurrences and sparsity (fcm). Code or tests that match the old text will need updating. (#2518)
Show all changes in 4.5.1Hide the rest of the changes in 4.5.1
  • featfreq() and docfreq() now work on tokens and tokens_xptr objects, computing feature and document frequencies directly without first creating a dfm. docfreq() supports all weighting schemes for these objects, but threshold is only supported for a dfm. (#2523)
  • Reduce memory usage for constructing a dfm from a large tokens object by excluding paddings from allocating memory when remove_padding = TRUE. If the object is too large, raises a user-friendly error.

From NEWS.md in the release

Install

Health

CRAN checks
2ERROR11OK
Check messages
ERRORtestsr-patched-linux-x86_64, r-release-windows-x86_64

r-patched-linux-x86_64

Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [101s/125s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > Sys.setenv("_R_CHECK_LENGTH_1_CONDITION_" = TRUE)
  > 
  > library(testthat)
  > library(quanteda)
  Package version: 4.5.0
  Unicode version: 17.0
  ICU version: 78.3
  Parallel computing: 3 of 32 threads used.
  See https://quanteda.io for tutorials and examples.
  > 
  > # for strong tests for Matrix deprecations
  > options(Matrix.warnDeprecatedCoerce = 2)
  > 
  > ops <- quanteda_options()
  > quanteda_options(reset = TRUE)
  > test_check("quanteda")
  Saving _problems/test-corpus-203.R
  Saving _problems/test-corpus-213.R
  [ FAIL 2 | WARN 0 | SKIP 28 | PASS 3290 ]
  
  ══ Skipped tests (28) ══════════════════════════════════════════════════════════
  • Behaviour changed - consider removing test (1): 'test-tokens.R:117:5'
  • Different behaviour for convert() v. old as.data.frame.dfm() (1):
    'test-as.dfm.R:134:5'
  
...[truncated]...
t2vec} is not installed (1): 'test-fcm.R:2:5'
  • {tibble} is not installed (1): 'test-corpus.R:268:5'
  • {tidytext} is not installed (1): 'test-as.dictionary.R:63:5'
  • {topicmodels} is not installed (1): 'test-convert.R:174:5'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-corpus.R:203:5'): test corpus constructor works for tm objects ──
  Error in `detach("package:NLP", unload = FALSE, force = TRUE)`: invalid 'name' argument
  Backtrace:
      ▆
   1. └─base::detach("package:NLP", unload = FALSE, force = TRUE) at test-corpus.R:203:5
  ── Error ('test-corpus.R:213:5'): test corpus constructor works for VCorpus with one document (#445) ──
  Error in `detach("package:NLP", unload = FALSE, force = TRUE)`: invalid 'name' argument
  Backtrace:
      ▆
   1. └─base::detach("package:NLP", unload = FALSE, force = TRUE) at test-corpus.R:213:5
  
  [ FAIL 2 | WARN 0 | SKIP 28 | PASS 3290 ]
  Error:
  ! Test failures.
  Execution halted

r-release-windows-x86_64

Running 'spelling.R' [0s]
  Running 'testthat.R' [103s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > Sys.setenv("_R_CHECK_LENGTH_1_CONDITION_" = TRUE)
  > 
  > library(testthat)
  > library(quanteda)
  Package version: 4.5.0
  Unicode version: 15.1
  ICU version: 74.1
  Parallel computing: 2 of 48 threads used.
  See https://quanteda.io for tutorials and examples.
  > 
  > # for strong tests for Matrix deprecations
  > options(Matrix.warnDeprecatedCoerce = 2)
  > 
  > ops <- quanteda_options()
  > quanteda_options(reset = TRUE)
  > test_check("quanteda")
  Saving _problems/test-corpus-203.R
  Saving _problems/test-corpus-213.R
  [ FAIL 2 | WARN 0 | SKIP 30 | PASS 3282 ]
  
  ══ Skipped tests (30) ══════════════════════════════════════════════════════════
  • Behaviour changed - consider removing test (1): 'test-tokens.R:117:5'
  • Different behaviour for convert() v. old as.data.frame.dfm() (1):
    'test-as.dfm.R:134:5'
  • On CRA
...[truncated]...
t2vec} is not installed (1): 'test-fcm.R:2:5'
  • {tibble} is not installed (1): 'test-corpus.R:268:5'
  • {tidytext} is not installed (1): 'test-as.dictionary.R:63:5'
  • {topicmodels} is not installed (1): 'test-convert.R:174:5'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-corpus.R:203:5'): test corpus constructor works for tm objects ──
  Error in `detach("package:NLP", unload = FALSE, force = TRUE)`: invalid 'name' argument
  Backtrace:
      ▆
   1. └─base::detach("package:NLP", unload = FALSE, force = TRUE) at test-corpus.R:203:5
  ── Error ('test-corpus.R:213:5'): test corpus constructor works for VCorpus with one document (#445) ──
  Error in `detach("package:NLP", unload = FALSE, force = TRUE)`: invalid 'name' argument
  Backtrace:
      ▆
   1. └─base::detach("package:NLP", unload = FALSE, force = TRUE) at test-corpus.R:213:5
  
  [ FAIL 2 | WARN 0 | SKIP 30 | PASS 3282 ]
  Error:
  ! Test failures.
  Execution halted

CRAN check page ↗

Slowest check: 11.3 min · r-devel-windows-x86_64
Status changes
  • ERROR11 OK, 2 ERROR2026-10-01
  • OK13 OK2026-08-12
  • NOTE12 OK, 1 NOTE2026-07-11
  • OK12 OK2026-04-25
  • NOTE12 OK, 2 NOTE2026-04-22
Show 2 earlier changesHide 2 earlier changes
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 4.5.1
READMEYes · 749 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 4.5.1Citation fileYes · cites a publicationWebsiteYes · pkgdown
Cites a JOSS paper
Help pages
163 (81 internal)includes a package overview page
Examples that run
94%102 run in a plain check · 6 never run
Exported functions with examples
87%
Documented parameters
97%
Return-value docs
75%
Help pages citing references
6%
Vignettes (1)

Downloads

236.5K
CRAN downloads in the past year
Rank #942 · ~648/day · ~19.7K/mo
Daily download trend is not available in this view yet.
16.6K30 days
44.5K90 days
236.5K1 year
Compare downloads with other packages →
Also on1.7K r2u3 autocran9.3K conda_forge279 c2d4u

Repository

893Stars
189Forks
52Open issues
3Open PRs
44Releases
12,124Commits
49Commit identities
rtext-analyticsnatural-language-processingcorpusquanteda
License file reads as GPL-3.0 · 12,124 commits · Last activity 2026-10-23 · +0.6% stars, 30d · Discussions: 6 posts
Responsiveness
How these are sampled
PRs merged (all time)
92%
Median days to close, 50 most recently updated closed issues
107
Median days to close, 50 most recently updated closed PRs
4

Stars over time

2025-10-21 · 8622026-10-14 · 893
PracticesBeta

11 development-tooling and community-health practices detected across 7 families in the upstream repository

Checks run against github.com/quanteda/quanteda on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Code of conductIssue templates
Docs source (3)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-21

pkgdown site last built 2026-07-29, before release 4.5.1 (2026-10-21)

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 3 practices
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
lintr
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-01-18
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude
    Commits: at least 1 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
Models named in its commits
  • Claude Opus 5.51 commit · Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
21 external dependencies (excludes base and recommended)

Installing quanteda adds 13 packages (10 with compiled code, 17 MB of source tarballs). Heaviest: stringi 11 MB, Rcpp 1.8 MB, jsonlite 1.0 MB.

Depends (2)
R >= 4.1.0methods
LinkingTo (1)
Enhances (0)
none

Datasets

People & History

People (11)
Maintainer since 0.7.2 (2015), Author, Copyright holder
Author · added in 1.3.0
Author · added in 1.3.0
Author · added in 1.0.0
Author
Author · added in 0.9.6-1
Author · added in 0.9.9-3
Contributor · added in 3.3.0
Contributor · added in 1.3.0
Funder · added in 1.3.0
ERC-2011-StG 283794-QUANTESS
Listed in earlier versions (9)
Show 8 of 9 peopleHide 8 people
Pablo Barberá
no longer listed · 0.7.2 to 0.9.8.5
no longer listed · 0.7.2 to 1.5.2
Will Lowe
no longer listed · 0.9.8 to 1.2.0
no longer listed · 1.3.0 to 2.1.2
no longer listed · 1.3.0 to 2.1.2
no longer listed · 1.3.0 to 1.5.2
Stuart Soroka
no longer listed · 1.3.0 to 2.1.2
Lori Young
no longer listed · 1.3.0 to 2.1.2
Releases (66)

Pick two releases to compare their code metrics.

  • 4.5.1Latest
    record
    2026-10-21 · current release · diff ↗ ·
    listed once in CRAN's queue
    Seen in one reading of CRAN's incoming queue, at 2026-10-21 10:55 UTC, so it stayed less than the time between readings.
  • 4.5.0
    record
    2026-08-04 · diff ↗ ·
    removed 1 export
    dictionary_tokenize
    added 3 exports
    tokenize_dictionary, tokens_match, tokens_recompile
  • R
    R 4.6.0 released · 2026-04-24
  • 4.4
    record
    2026-04-06 · diff ↗ ·
    added 5 exports
    as.tensor, dictionary_tokenize, normalize_characters, tokenize_paragraph, tokens_annotate
  • 4.3.1
    record
    2025-07-10 · diff ↗
  • 4.3.0
    record
    2025-05-20 · diff ↗ ·
    added 1 export
    corpus_chunk
  • R
    R 4.5.0 released · 2025-04-11
  • 4.2.0
    record
    2025-01-08 · diff ↗
  • 4.1.0
    record
    2024-09-04 · diff ↗ ·
    added 1 export
    tokens_trim
  • 4.0.2
    record
    2024-04-24 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 4.0.1
    record
    2024-04-08 · diff ↗ ·
    added 1 export
    info_tbb
  • 4.0.0
    record
    2024-04-04 · diff ↗ ·
    removed 1 export
    index_types
    added 5 exports
    as.tokens_xptr, concat, concatenator, is.tokens_xptr, tokens_restore
  • 3.3.1
    record
    2023-05-18 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 3.3.0
    record
    2023-04-07 · diff ↗ ·
    removed 1 export
    tokenize_word
    added 8 exports
    breakrules_get, breakrules_reset, breakrules_set, segid, tokenize_custom, tokenize_word2, tokenize_word3, tokenize_word4
Show 63 earlier eventsHide 63 earlier events
  • 3.2.4
    record
    2022-12-08 · diff ↗
  • 3.2.3
    record
    2022-08-29 · diff ↗
  • 3.2.2
    record
    2022-08-09 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 3.2.1
    record
    2022-03-01 · diff ↗
  • 3.2.0
    record
    2021-11-30 · diff ↗
  • 3.1.0
    record
    2021-08-17 · diff ↗ ·
    added 1 export
    as.phrase
  • R
    R 4.1.0 released · 2021-05-18
  • 3.0.0
    record
    2021-04-06 · diff ↗ ·
    removed 33 exports
    metacorpus<-, metadoc<-, View, as.DocumentTermMatrix, as.igraph, as.network, as.wfm, char_edit, char_tortl, char_trimsentences, corpus_trimsentences, dictionary_edit, list_edit, metacorpus, metadoc, nscrabble, nsyllable, textplot_keyness, textplot_network, textplot_wordcloud, textplot_xray, textstat_collocations, textstat_dist, textstat_entropy, textstat_frequency, textstat_keyness, textstat_lexdiv, textstat_proxy, textstat_readability, textstat_select and 3 more
    added 10 exports
    check_character, check_double, check_integer, check_logical, corpus_group, index, is.index, object2fixed, object2id, tokens_group
  • 2.1.2
    record
    2020-09-23 · diff ↗
  • 2.1.1
    record
    2020-07-27 · diff ↗
  • 2.1.0
    record
    2020-07-05 · diff ↗ ·
    added 7 exports
    char_edit, char_keep, char_remove, char_select, dictionary_edit, list_edit, textstat_summary
  • R
    R 4.0.0 released · 2020-04-24
  • 2.0.1
    record
    2020-03-18 · diff ↗
  • 2.0.0
    record
    2020-02-26 · diff ↗ ·
    removed 25 exports
    settings<-, affinity, as.coefficients_textmodel, as.statistics_textmodel, as.summary.textmodel, coefficients.textmodel_ca, coefficients.textmodel_lsa, coefficients.textmodel_wordfish, is.corpuszip, nfeature, scrabble, settings, spacy_parse, textmodel_affinity, textmodel_ca, textmodel_lsa, textmodel_nb, textmodel_wordfish, textmodel_wordscores, textplot_influence, textplot_scale1d, textstat_dist_old, textstat_simil_old, tf, tfidf
    added 10 exports
    meta<-, as.fcm, docid, meta, tokenize_character, tokenize_fasterword, tokenize_fastestword, tokenize_sentence, tokenize_word, tokenize_word1
  • 1.5.2
    record
    2019-11-26 · diff ↗ ·
    added 1 export
    featfreq
  • 1.5.1
    record
    2019-07-30 · diff ↗
  • 1.5.0
    record
    2019-07-04 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 1.4.3
    record
    2019-04-01 · diff ↗
  • 1.4.1
    record
    2019-02-26 · diff ↗
  • 1.4.0
    record
    2019-01-30 · diff ↗ ·
    added 5 exports
    dfm_match, flatten_dictionary, textstat_entropy, tokens_chunk, tokens_split
  • 1.3.14
    record
    2018-11-19 · diff ↗
  • 1.3.13
    record
    2018-11-01 · diff ↗ ·
    added 4 exports
    textstat_dist_old, textstat_proxy, textstat_simil_old, tokens_sample
  • 1.3.4
    record
    2018-07-15 · diff ↗ ·
    added 1 export
    as.igraph
  • 1.3.0
    record
    2018-06-05 · diff ↗ ·
    added 2 exports
    char_tortl, tokens_tortl
  • R
    R 3.5.0 released · 2018-04-23
  • 1.2.0
    record
    2018-04-15 · diff ↗ ·
    added 3 exports
    index_types, pattern2fixed, pattern2id
  • 1.1.1
    record
    2018-03-07 · diff ↗
  • 1.1.0
    record
    2018-03-05 · diff ↗ ·
    added 3 exports
    as.coefficients_textmodel, as.statistics_textmodel, as.summary.textmodel
  • 1.0.0
    record
    2018-01-28 · diff ↗ ·
    removed 7 exports
    collocations, dfm2ldaformat, quantedaformat2dtm, sequences, syllables, textmodel, textmodel_wordshoal
    added 14 exports
    affinity, as.network, coefficients.textmodel_ca, coefficients.textmodel_lsa, coefficients.textmodel_wordfish, dfm_replace, dfm_tfidf, nfeat, textmodel_affinity, textmodel_lsa, textplot_influence, textplot_network, textstat_select, tokens_subset
  • 0.99.22
    record
    2017-11-13 · diff ↗ ·
    removed 25 exports
    applyDictionary, as.tokenizedTexts, changeunits, compress, features, is.tokenizedTexts, joinTokens, ngrams, removeFeatures, segment, selectFeatures, selectFeaturesOLD, similarity, skipgrams, smoother, textfile, textmodel_NB, toLower, toUpper, tokenize, tokens_hash, trim, trimdfm, weight, wordstem
    added 7 exports
    dfm_keep, fcm_keep, spacy_parse, textmodel_nb, tokens_keep, tokens_replace, types
  • 0.99.12
    record
    2017-10-06 · diff ↗
  • 0.99.9
    record
    2017-09-22 · diff ↗ ·
    added 2 exports
    %>%, tokens_segment
  • 0.99
    record
    2017-08-16 · diff ↗ ·
    removed 4 exports
    collocations2, is.sequences, ngrams.default, ngrams.tokenizedTexts
    added 6 exports
    as.dictionary, dfm_subset, is.phrase, phrase, textplot_keyness, textstat_frequency
  • 0.9.9-65
    record
    2017-05-26 · diff ↗ ·
    removed 1 export
    phrasetotoken
    added 3 exports
    char_trim, corpus_trim, dfm_group
  • R
    R 3.4.0 released · 2017-04-21
  • 0.9.9-50
    record
    2017-04-20 · diff ↗ ·
    removed 3 exports
    as.kwic, kwic_old, sample
    added 8 exports
    as.yaml, bootstrap_dfm, char_trimsentences, collocations2, corpus_trimsentences, is.sequences, quanteda_options, textstat_collocations
  • 0.9.9-24
    record
    2017-02-14 · diff ↗
  • 0.9.9-22
    record
    2017-02-09 · diff ↗
  • 0.9.9-17
    record
    2017-01-27 · diff ↗ ·
    removed 1 export
    corpuszip
    added 1 export
    textstat_keyness
  • 0.9.9-3
    record
    2017-01-10 · diff ↗ ·
    removed 5 exports
    describeTexts, encoding, findSequences, lexdiv, readability
    added 66 exports
    View, as.corpus, as.kwic, as.tokens, char_ngrams, char_segment, char_tolower, char_toupper, char_wordstem, corpus_reshape, corpus_sample, corpus_segment, corpus_subset, corpuszip, dfm_compress, dfm_lookup, dfm_remove, dfm_sample, dfm_select, dfm_smooth, dfm_sort, dfm_tolower, dfm_toupper, dfm_trim, dfm_weight, dfm_wordstem, fcm, fcm_compress, fcm_remove, fcm_select and 36 more
  • 0.9.8.5
    record
    2016-10-31 · diff ↗
  • 0.9.8.3
    record
    2016-10-16 · diff ↗
  • 0.9.8
    record
    2016-07-28 · diff ↗
  • 0.9.7-17
    record
    2016-06-21 · diff ↗
  • 0.9.7-16
    record
    2016-06-20 · diff ↗ ·
    added 4 exports
    findSequences, joinTokens, selectFeaturesOLD, toUpper
  • 0.9.6-9
    record
    2016-05-21 · diff ↗ ·
    added 1 export
    as.tokenizedTexts
  • 0.9.6-1
    record
    2016-05-09 · diff ↗ ·
    removed 4 exports
    cbind.dfm, df, phrasetotoken.corpus, weighting
    added 2 exports
    texts<-, compress
  • R
    R 3.3.0 released · 2016-05-03
  • 0.9.4
    record
    2016-02-21 · diff ↗ ·
    added 1 export
    textmodel_NB
  • 0.9.2-0
    record
    2016-01-11 · diff ↗ ·
    removed 2 exports
    stopwordsGet, stopwordsRemove
    added 1 export
    df
  • 0.9.0-1
    record
    2015-11-27 · diff ↗ ·
    added 1 export
    cbind.dfm
  • 0.8.6-0
    record
    2015-10-15 · diff ↗ ·
    added 1 export
    is.tokenizedTexts
  • 0.8.4-2
    record
    2015-09-09 · diff ↗ ·
    removed 1 export
    bigrams
    added 1 export
    skipgrams
  • 0.8.2-1
    record
    2015-08-18 · diff ↗ ·
    added 1 export
    sample
  • 0.8.2-0
    record
    2015-07-31 · diff ↗ ·
    removed 2 exports
    clean, cleanC
    added 3 exports
    applyDictionary, scrabble, selectFeatures
  • 0.8.0-4
    record
    2015-07-13 · diff ↗
  • 0.8.0-3
    record
    2015-07-11 · diff ↗ ·
    removed 6 exports
    encoding<-, language<-, texts<-, language, tokenizeOnlyCppKB, tokenizeOnlyScan
    added 4 exports
    nsentence, ntype, readability, toLower
  • 0.7.2-1
    record
    2015-06-02 · diff ↗
  • R
    R 3.2.0 released · 2015-04-16
  • 0.7.2
    record
    2015-04-07
  • R
    R 3.1.0 released · 2014-04-10
Across CRAN, the median accepted release of the past year spent 26 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2015-04-07
Total releases
66 / 11 yrs
License
GPL-3 OSI
Minimum R
≥ 4.1.0
Bundled data
248 KB / 5 files
Download size
4.2 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("quanteda")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for quanteda version 4.5.1 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy