Visualization with tm
Explore how to create visual representations of text data using the tm package in R. Understand the process from building a corpus, constructing a term-document matrix, to plotting top term frequencies with base R functions. Gain practical skills to illustrate NLP results through barplots and other graphical displays.
We'll cover the following...
Visualizing NLP with R
The tm package provides tools for manipulating natural language datasets and drawing statistical conclusions from those data sets. It provides surprisingly few tools for visualizing those conclusions, instead relying on the rich set of graphics available through base R and other packages.
Here’s an example of using tm to create a data object from a novel and then using the barplot() function available through base R:
Let’s break this code down step by step:
...