plot.CoCA: Plot CoCA

View source: R/CoCA.R

plot.CoCAR Documentation

Plot CoCA

Description

Plot CoCA

Usage

## S3 method for class 'CoCA'
plot(
  x,
  module = NULL,
  min = 0.15,
  max = 1,
  label.cex = 1.2,
  seed = 123,
  main = NULL,
  ...
)

Arguments

x

CoCA object returned by CoCA()

module

Integer, which schematic class to plot. Defaults to NULL, but a value is effectively required: omitting it or passing NULL errors, prompting you to specify one. Must be a single whole number between 1 and the number of modules found in x (length(x$modules)), else errors with a message stating the valid range.

min

edges with absolute weights under this value are not shown (default = 0.15)

max

highest weight to scale the edge widths too (default = 1)

label.cex

label size scaling factor (default = 1.2)

seed

random seed for layout reproducibility (default = 123)

main

title for plot (default = NULL)

...

Arguments to be passed to methods

Value

invisibly returns the igraph object

Examples


data(ft_wv_sample)
data(jfk_speech)
jfk_speech$sentence <- tolower(jfk_speech$sentence)
jfk_speech$sentence <- gsub("[[:punct:]]+", " ", jfk_speech$sentence)
dtm <- dtm_builder(jfk_speech, sentence, sentence_id)

gen <- data.frame(pole1 = c("man", "new", "choose"), pole2 = c("nation", "world", "peace"))
space <- data.frame(pole1 = c("space", "moon", "science"), pole2 = c("nation", "world", "freedom"))
power <- data.frame(pole1 = c("great", "power", "new"), pole2 = c("peace", "freedom", "world"))

gen_dir <- get_direction(anchors = gen, wv = ft_wv_sample)
space_dir <- get_direction(anchors = space, wv = ft_wv_sample)
power_dir <- get_direction(anchors = power, wv = ft_wv_sample)
directions <- rbind(gen_dir, space_dir, power_dir)

classes <- CoCA(dtm, wv = ft_wv_sample, directions = directions)



text2map documentation built on Sept. 23, 2026, 5:07 p.m.