Count words or other features
Examples
if (FALSE) { # \dontrun{
my_corpus <- load_texts()
my_bigrams <- my_corpus |>
add_frequency()
} # }
dubliners <- get_gutenberg_corpus(2814) |>
load_texts() |>
identify_by(part) |>
standardize_titles()
dubliners |>
add_frequency() |>
head()
#> # A tibble: 6 × 6
#> doc_id title author part word n
#> <fct> <chr> <chr> <chr> <chr> <int>
#> 1 The Sisters Dubliners Joyce, James THE SISTERS there 15
#> 2 The Sisters Dubliners Joyce, James THE SISTERS was 56
#> 3 The Sisters Dubliners Joyce, James THE SISTERS no 16
#> 4 The Sisters Dubliners Joyce, James THE SISTERS hope 1
#> 5 The Sisters Dubliners Joyce, James THE SISTERS for 32
#> 6 The Sisters Dubliners Joyce, James THE SISTERS him 43