plot {tm} | R Documentation |
Visualize correlations between terms of a term-document matrix.
## S3 method for class 'TermDocMatrix': plot(x, terms = sample(colnames(x), 20), corThreshold = 0.7, weighting = FALSE, attrs = list(graph = list(rankdir = "BT"), node = list(shape = "rectangle", fixedsize = FALSE)), ...)
x |
an R object inheriting from S4 class
TermDocMatrix . |
terms |
Terms to be plotted. Defaults to 20 randomly chosen terms of the term-document matrix. |
corThreshold |
Do not plot correlations below this
threshold. Defaults to 0.7 . |
weighting |
Define whether the line width corresponds to the correlation. |
attrs |
Argument passed to the plot method for class
graphNEL . |
... |
Other arguments passed to the
graphNEL plot method. |
Visualization requires that package Rgraphviz is available.
if (require("Rgraphviz")) { data(crude) tdm <- TermDocMatrix(crude) plot(tdm, terms = colnames(tdm)[1:20]) set.seed(1234) plot(tdm, corThreshold = 0.2, weighting = TRUE) }