tm_cooc: Analyse word co-occurrence in subject lines and return a...

View source: R/tm_cooc.R

tm_coocR Documentation

Analyse word co-occurrence in subject lines and return a network plot

Description

This function generates a word co-occurrence network plot, with options to return a table. This function is used within meeting_tm_report().

Usage

tm_cooc(data, stopwords = NULL, seed = 100, return = "plot", lmult = 0.05)

Arguments

data

A Meeting Query dataset in the form of a data frame.

stopwords

A character vector OR a single-column data frame labelled 'word' containing custom stopwords to remove.

seed

A numeric vector to set seed for random generation.

return

String specifying what to return. This must be one of the following strings:

  • "plot"

  • "table"

See Value for more information.

lmult

A multiplier to adjust the line width in the output plot. Defaults to 0.05.

Details

This function uses tm_clean() as the underlying data wrangling function. There is an option to remove stopwords by passing a data frame into the stopwords argument.

Value

A different output is returned depending on the value passed to the return argument:

  • "plot": 'ggplot' and 'ggraph' object. A network plot.

  • "table": data frame. A summary table.

Author(s)

Carlos Morales carlos.morales@microsoft.com

See Also

Other Text-mining: meeting_tm_report(), pairwise_count(), subject_validate_report(), subject_validate(), tm_clean(), tm_freq(), tm_wordcloud()

Examples


# Demo using a subset of `mt_data`
mt_data %>%
  dplyr::slice(1:20) %>%
  tm_cooc(lmult = 0.01)



wpa documentation built on Aug. 21, 2023, 5:11 p.m.

Related to tm_cooc in wpa...