Skip to contents

Visualize the correlation relationships between terms in the corpus based on pairwise correlations.

Usage

plot_word_correlation_network(
  dfm_object,
  co_occur_n = 30,
  corr_n = 0.4,
  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 30).

corr_n

Minimum correlation value for filtering terms (default is 0.4).

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 correlation 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_correlation_network(
    dfm_object,
    co_occur_n = 30,
    corr_n = 0.4,
    height = 900,
    width = 800)
}