Learn R Programming

textir (version 1.8-5)

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; this will be used to color the topic-weight shadings. See the textir dataset examples, which color by good reviews for the we8there data or by repub
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 and Selection for Topic Models. http://arxiv.org/abs/1109.4518

See Also

topics, summary.topics, we8there, congress109, wsjibm