Learn R Programming

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

koRpus

koRpus is an R package for text analysis. This includes, amongst others, a wrapper for the POS tagger TreeTagger, functions for automatic language detection, hyphenation, several indices of lexical diversity (e.g., type token ratio, HD-D/vocd-D, MTLD) and readability (e.g., Flesch, SMOG, LIX, Dale-Chall, Tuldava).

koRpus also includes a plugin for RKWard, a powerful GUI and IDE for R, providing graphical dialogs for its basic features. To make full use of this feature, please install RKWard (plugins are detected automatically).

More information on koRpus is available on the project homepage.

Installation

There are three easy ways of getting koRpus:

Stable releases via CRAN

The latest release that is considered stable for productive work can be found on the CRAN mirrors, which means you can install it from a running R session like this:

install.packages("koRpus")

The CRAN packages are usually a bit behind the recent state of the package, and only updated after a significant amount of changes or important bug fixes.

Development releases via the project repository

Inbetween stable CRAN releases there's usually several testing or development versions released on the project's own repository. These releases should also work without problems, but they are also intended to test new features or supposed bug fixes, and get feedback before the next release goes to CRAN.

Installation is fairly easy, too:

install.packages("koRpus", repo=c(getOption("repos"), reaktanz="https://reaktanz.de/R"))

To automatically get updates, consider adding the repository to your R configuration. You might also want to subscribe to the package's RSS feed to get notified of new releases.

If you're running a Debian based operating system, you might be interested in the precompiled *.deb packages.

Installation via GitHub

To install it directly from GitHub, you can use install_github() from the devtools package:

devtools::install_github("unDocUMeantIt/koRpus") # stable release
devtools::install_github("unDocUMeantIt/koRpus", ref="develop") # development release

Installing language support

koRpus does not support any particular language out-of-the-box. Therefore, after installing the package you'll have to also install at least one language support package to really make use of it. You can find these in the l10n repository, they're called koRpus.lang.*.

The most straight forward way to get these packages is to use the function install.koRpus.lang(). Here's an example how to install support for English and German:

library(koRpus)
install.koRpus.lang(lang=c("en", "de"))

There's also precompiled Debian packages.

Contributing

To ask for help, report bugs, suggest feature improvements, or discuss the global development of the package, please either subscribe to the koRpus-dev mailing list, or use the issue tracker on GitHub.

Branches

Please note that all development happens in the develop branch. Pull requests against the master branch will be rejected, as it is reserved for the current stable release.

Licence

Copyright 2012-2020 Meik Michalke meik.michalke@hhu.de

koRpus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

koRpus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with koRpus. If not, see https://www.gnu.org/licenses/.

Copy Link

Version

Install

install.packages('koRpus')

Monthly Downloads

3,694

Version

0.13-6

License

GPL (>= 3)

Maintainer

Meik Michalke

Last Published

May 9th, 2021

Functions in koRpus (0.13-6)

C.ld

Lexical diversity: Herdan's C
HDD

Lexical diversity: HD-D (vocd-d)
ARI

Readability: Automated Readability Index (ARI)
FORCAST

Readability: FORCAST Index
K.ld

Lexical diversity: Yule's K
LIX

Readability: Bj\"ornsson's L\"asbarhetsindex (LIX)
CTTR

Lexical diversity: Carroll's corrected TTR (CTTR)
DRP

Readability: Degrees of Reading Power (DRP)
FOG

Readability: Gunning FOG Index
ELF

Readability: Fang's Easy Listening Formula (ELF)
MTLD

Lexical diversity: Measure of Textual Lexical Diversity (MTLD)
cTest

Transform text into C-Test-like format
R.ld

Lexical diversity: Guiraud's R
danielson.bryan

Readability: Danielson-Bryan
TTR

Lexical diversity: Type-Token Ratio
correct.tag

Methods to correct koRpus objects
dickes.steiwer

Readability: Dickes-Steiwer Handformel
SMOG

Readability: Simple Measure of Gobbledygook (SMOG)
flesch.kincaid

Readability: Flesch-Kincaid Grade Level
freq.analysis

Analyze word frequencies
TRI

Readability: Kuntzsch's Text-Redundanz-Index
guess.lang

Guess language a text is written in
RIX

Readability: Anderson's Readability Index (RIX)
kRp.cluster

Work in (early) progress. Probably don't even look at it. Consider it pure magic that is not to be tempered with.
kRp.lang,-class

S4 Class kRp.lang
U.ld

Lexical diversity: Uber Index (U)
clozeDelete

Transform text into cloze test format
gutierrez

Readability: Guti<U+00E9>rrez F<U+00F3>rmula de comprensibilidad
MATTR

Lexical diversity: Moving-Average Type-Token Ratio (MATTR)
coleman

Readability: Coleman's Formulas
MSTTR

Lexical diversity: Mean Segmental Type-Token Ratio (MSTTR)
kRp.corp.freq,-class

S4 Class kRp.corp.freq
install.koRpus.lang

Install language support packages
dale.chall

Readability: Dale-Chall Readability Formula
bormuth

Readability: Bormuth's Mean Cloze and Grade Placement
filterByClass

Remove word classes
fucks

Readability: Fucks' Stilcharakteristik
koRpus-deprecated

Deprecated object classes
S.ld

Lexical diversity: Summer's S
available.koRpus.lang

List available language packages
pasteText

Paste koRpus objects
flesch

Readability: Flesch Readability Ease
coleman.liau

Readability: Coleman-Liau Index
koRpus-package

koRpus
docTermMatrix

Generate a document-term matrix
maas

Lexical diversity: Maas' indices
textTransform

Letter case transformation
jumbleWords

Produce jumbled words
read.BAWL

Import BAWL-R data
kRp.readability,-class

S4 Class kRp.readability
get.kRp.env

Get koRpus session settings
wheeler.smith

Readability: Wheeler-Smith Score
tokenize

A simple tokenizer
lex.div

Analyze lexical diversity
traenkle.bailer

Readability: Traenkle-Bailer Formeln
harris.jacobson

Readability: Harris-Jacobson indices
hyphen,kRp.text-method

Automatic hyphenation
plot

Plot method for objects of class kRp.text
kRp.TTR,-class

S4 Class kRp.TTR
query

A method to get information out of koRpus objects
readability

Measure readability
taggedText

Getter/setter methods for koRpus objects
show,kRp.lang-method

Show methods for koRpus objects
nWS

Readability: Neue Wiener Sachtextformeln
read.corp.custom

Import custom corpus data
set.lang.support

Add support for new languages
spache

Readability: Spache Formula
kRp.text,-class

S4 Class kRp.text
kRp.POS.tags

Get elaborated word tag definitions
linsear.write

Readability: Linsear Write Index
readTagged

Import already tagged texts
textFeatures

Extract text features for authorship analysis
summary

Summary methods for koRpus objects
set.kRp.env

A function to set information on your koRpus environment
readability.num

Calculate readability
read.corp.celex

Import Celex data
tuldava

Readability: Tuldava's Text Difficulty Formula
read.corp.LCC

Import LCC data
types

Get types and tokens of a given text
lex.div.num

Calculate lexical diversity
segment.optimizer

A function to optimize MSTTR segment sizes
farr.jenkins.paterson

Readability: Farr-Jenkins-Paterson Index
strain

Readability: Strain Index
treetag

A method to call TreeTagger
split_by_doc_id

Turn a multi-document kRp.text object into a list of kRp.text objects