Skip to contents

TTR reports the ratio of unique word types to the total size of a text.

Usage

get_ttr(x)

Arguments

x

A vector, such as a column of character strings

Value

A vector of ratios

See also

Examples

c("cat", "dog", "dog", "bat", "dog") |>
  get_ttr()
#> [1] 1.0000000 1.0000000 0.6666667 0.7500000 0.6000000