O'Reilly logo

R: Recipes for Analysis, Visualization and Machine Learning by Chiu Yu-Wei, Atmajitsinh Gohil, Shanthi Viswanathan, Viswa Viswanathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constructing a correlation plot and a phrase tree

In the previous recipe, we learned how to create a comparison cloud, which allows us to study the differences or similarities between two documents. In the process, we generated the term document matrix. In this recipe, we will learn some important matrix functions that allow us to further conduct text analysis and also generate a correlation plot.

We will also learn how to generate a phrase tree or a word tree. Wattenberg and Viegas (2008) state that a word tree places a tree structure for the words that follow a particular search term and uses that structure to arrange those words spatially. At the time of writing this book, I was unable to find a package that would allow me to construct a word ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required