plot_specificities: Plot specificities of cat1 (lemma or word) according to cat2...

View source: R/plot_specificities.R

plot_specificitiesR Documentation

Plot specificities of cat1 (lemma or word) according to cat2 (categories)

Description

Plot specificities of cat1 (lemma or word) according to cat2 (categories)

Usage

plot_specificities(df_spec, cat1, cat2)

Arguments

df_spec

a tibble with specifictities of cat1 according to cat2

cat1

words or lemmas

cat2

categories

Value

a plot

Examples

mydf=dplyr::bind_rows(tibble::tibble(txt=janeaustenr::prideprejudice,
                                     novel="Pride and Prejudice"),
                      tibble::tibble(txt=janeaustenr::sensesensibility,
                                     novel="Sense and Sensibility")) %>%
 tidytext::unnest_tokens(word,txt)
df_spec <- tidy_specificities(mydf,
                              cat1=word,
                              cat2=novel,
                              min_spec=5)
plot_specificities(df_spec,
                   cat1=word,
                   cat2=novel)

lvaudor/mixr documentation built on April 14, 2024, 2:17 p.m.