Skip to contents

HTR reports the cumulative ratio of hapax legomena (one-off words) to the cumulative size of a text. This operation can be slow.

Usage

get_htr(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_htr()
#> [1] 1.0000000 1.0000000 0.3333333 0.5000000 0.4000000