TTR reports the ratio of unique word types to the total size of a text.
See also
Other vectorized functions:
get_cumulative_vocabulary(),
get_frequency(),
get_hir(),
get_htr(),
get_idf_by(),
get_match(),
get_sentiment(),
get_tf_by(),
get_tfidf_by(),
is_hapax(),
is_new()
Examples
c("cat", "dog", "dog", "bat", "dog") |>
get_ttr()
#> [1] 1.0000000 1.0000000 0.6666667 0.7500000 0.6000000
