Fast n-Gram 'Tokenization'
Overview
An n-gram is a sequence of n "words" taken, in order, from a body of text. This is a collection of utilities for creating, displaying, summarizing, and "babbling" n-grams. The 'tokenization' and "babbling" are handled by very efficient C code, which can even be built as its own standalone library. The babbler is a simple Markov chain. The package also offers a vignette with complete example 'workflows' and information about the utilities offered in the package.
Install
Health
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Drew Schmidt <wrathematics@gmail.com>’
Found the following (possibly) invalid file URI:
URI: openclipart.org
From: inst/doc/ngram-guide.pdf- NOTE11 OK, 2 NOTENow
- NOTE11 OK, 1 NOTE, 1 FAILURE2026-06-08
- ERROR11 OK, 1 NOTE, 1 ERROR2026-06-07
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 16includes a package overview page
- Examples that run
- 92%11 run in a plain check · 1 never run
- Exported functions with examples
- 92%
- Documented parameters
- 85%
- Return-value docs
- 69%
- Help pages citing references
- 0%
Also includes 1 demo script (run with demo())
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/wrathematics/ngram on 2026-10-18.
Dependencies
Installing ngram adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 3.2.3Latest
- RR 4.3.0 released · 2023-04-21
- 3.2.22022-10-31 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 3.2.12022-03-14 · diff ↗
- 3.2.0
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 3.0.42017-11-21 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 3.0.32017-03-24 · diff ↗
Show 8 earlier eventsHide 8 earlier events
- 3.0.22017-01-17 · diff ↗
- 3.0.12016-07-13 · diff ↗
- 3.0.02016-05-10 · diff ↗ ·
removed 1 export
concatadded 14 exports
babble, concatenate, get.nextwords, get.ngrams, get.phrasetable, get.string, getseed, multiread, ngram, ngram_asweka, rcorpus, splitter, string.summary, wordcount - RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- 1.12014-06-25 · diff ↗
- 1.02014-06-23
- RR 3.1.0 released · 2014-04-10
Package metadata
- First published
- 2014-06-23
- Total releases
- 11 / 12 yrs
- License
- BSD 2-clause License + file LICENSE
- Minimum R
- ≥ 3.0.0
- Download size
- 242 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ngram")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.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.