Skip to contents

Computes the Average Word Length (AWL) and Type-Token Ratio (TTR) of a vector of words.

Usage

add_awl_ttr(vec, ttr = 400)

Arguments

vec

The vector of words for which to compute AWL and TTR.

ttr

The number of words to consider for TTR calculation. Default is 400.

Value

A tibble containing the AWL and TTR values.

Examples


add_awl_ttr(c("Hello world", "This is R"))
#> # A tibble: 1 × 2
#>     AWL   TTR
#>   <dbl> <dbl>
#> 1   NaN   Inf