Learn R Programming

stm (version 1.3.5)

plot.topicCorr: Plot a topic correlation graph

Description

Uses a topic correlation graph estimated by topicCorr and the igraph package to plot a network where nodes are topics and edges indicate a positive correlation.

Usage

# S3 method for topicCorr
plot(x, topics = NULL, vlabels = NULL,
  layout = NULL, vertex.color = "green", vertex.label.cex = 0.75,
  vertex.label.color = "black", vertex.size = NULL, ...)

Arguments

x

A topicCorr model object.

topics

A vector of topics to include in the plot, defaults to all.

vlabels

A character vector of labels for the vertices. Defaults to "Topic #"

layout

The layout algorithm passed to the igraph package. It will choose layout.fruchterman.reingold by default. Note that to pass an alternate algorithm you should load the igraph package first.

vertex.color

Color of the vertices.

vertex.label.cex

Controls the size of the labels.

vertex.label.color

Controls the color of the labels.

vertex.size

Controls the sizes of the vertices, either NULL, a scalar or a vector of the same length as number of topics.

Additional parameters passed to plot.graph.adjacency

Details

Essentially a thin wrapper around the plotting functionality in the igraph package. See package vignette for more details.

References

Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.sf.net

See Also

topicCorr

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
#This function becomes more useful with larger numbers of topics.
#it is demonstrated here with a small model simply to show how the syntax works.
cormat <- topicCorr(gadarianFit)
plot(cormat)
# }

Run the code above in your browser using DataLab