Learn R Programming

textir (version 1.4)

plot.topics: topic plots

Description

Plot function for Topic Models

Usage

## S3 method for class 'topics':
plot(x, type=c("weight","resid"), group=NULL, labels=NULL, 
col=NULL, xlab=NULL, ylab=NULL, main=NULL, tpk=NULL, lgd.K=NULL, 
cex.lgdc = 1, cex.lgdt = 1, cex.rmar= 1, ... )

Arguments

x
An output object from the topics function.
type
If "weight", the default, provide an image plot of document-topic weights. If "resid", just show a simple histogram of standardized residuals for the positive count entries.
group
Optional logical vector containing membership in some group for each document (e.g., good reviews for the we8there data, or republicans in the congress109 example). This will be used to color the topic-weight shadings.
labels
Optional length-two character vector of labels for the membership specified in groups. labels[1] corresponds to group=FALSE and labels[2] to group=TRUE.
col
If type="weight", a number from 1:4 specifying the shade color (grey, followed by red, green blue). If group is specified, col[1] corresponds to group=FALSE, and col[2] to
xlab
Optional x-axis label.
ylab
Optional y-axis label.
main
Optional title.
tpk
Optional list of topics to plot. Defaults to 1:x$K.
lgd.K
Optional number of topic-increments (along the X-axis) outside of the plot region at which the legend is centered.
cex.lgdc
Magnification factor for legend color-boxes.
cex.lgdt
Magnification factor for legend text.
cex.rmar
Magnification factor for the right plot margin.
...
Additional arguments to the image function.

Value

  • A fabulous plot.

References

Taddy (2011), Estimation of Topic Models.

See Also

topics, summary.topics, we8there, congress109, wsjibm