type_token_ratio: Type-Token Ratio

View source: R/type_token_ratio.R

type_token_ratioR Documentation

Type-Token Ratio

Description

Calculate type-token ratio by grouping variable.

Usage

type_token_ratio(text.var, grouping.var = NULL, n.words = 1000, ...)

Arguments

text.var

The text variable

grouping.var

The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.

n.words

An integer specifying the number of words in each chunk.

...

ignored.

Value

Returns a list of class type_text_ratio. This object contains a type-token ratio for the overall text and a data frame type-token ratios per grouping vriable.

References

Baker, P. (2006) Using Corpora in Discourse Analysis. London: Continuum.

Examples

with(raj, type_token_ratio(dialogue, person))
plot(with(raj, type_token_ratio(dialogue, person)))

qdap documentation built on May 31, 2023, 5:20 p.m.