terms_graph: terms_graph

View source: R/graph.R

terms_graphR Documentation

terms_graph

Description

Plot a graph of terms.

Usage

terms_graph(
  dtm,
  n = 100,
  min_occ = 0,
  interactive = base::interactive(),
  vertex.label.cex = 1,
  ...
)

Arguments

dtm

A DocumentTermMatrix object.

n

The maximum number of terms to represent.

min_occ

The minimum number of occurrences for a term to be retained.

interactive

If TRUE, show an interactive plot using igraph::tkplot. This is the case by default for interactive sessions.

vertex.label.cex

The font size for vertex labels. It is interpreted as a multiplication factor of some device-dependent base font size.

...

Optional arguments passed to igraph::plot.igraph or igraph::tkplot.

Value

The ID of the plot returned by igraph::tkplot if interactive=TRUE, or NULL invisibly otherwise.

Examples


file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
terms_graph(dtm, 100, 3)


R.temis documentation built on Aug. 25, 2025, 5:12 p.m.

Related to terms_graph in R.temis...