Skip to contents

Visualize the co-occurrence relationships between terms in the corpus based on pairwise counts.

Usage

plot_word_co_occurrence_network(
  dfm_object,
  co_occur_n = 200,
  height = 900,
  width = 800
)

Arguments

dfm_object

A quanteda document-feature matrix (dfm).

co_occur_n

Minimum number of co-occurrences for filtering terms (default is 200).

height

The height of the resulting Plotly plot, in pixels. Defaults to 900.

width

The width of the resulting Plotly plot, in pixels. Defaults to 800.

Value

A Plotly object visualizing the interactive word co-occurrence network.

Examples

if (interactive()) {
  df <- TextAnalysisR::SpecialEduTech
  united_tbl <- TextAnalysisR::unite_text_cols(df, listed_vars = c("title", "keyword", "abstract"))
  tokens <- TextAnalysisR::preprocess_texts(united_tbl, text_field = "united_texts")
  dfm_object <- quanteda::dfm(tokens)
  TextAnalysisR::plot_word_co_occurrence_network(
    dfm_object,
    co_occur_n = 200,
    height = 900,
    width = 800)
}