Preparing data for plotting
There are many kinds of graphics, for instance, univariate, bivariate with one numeric and one categorical variable or two numeric variables, and others. The input data will be different for each of them, requiring the data scientist to munge the data to fit a specific format to plot it. An example studied in this book was the data that was not in tidy format, requiring transformations before it could be plotted.
In this section, we will learn how to prepare a text to be plotted as a word cloud, which is a graphical way to show the content of text. A word cloud is a graphical representation of the most frequent words that appear in a text. The more frequently the word occurs, the bigger it appears in the plot, consequently providing a sense of the content of the text.
A text is a combination of words, but it does not have rows and columns of data. Instead, it is a whole piece. So, prior to plotting the word cloud, it is necessary to transform the...