Introduction
You now have your data in R (as discussed in Chapter 1, Acquiring Data for Your Project) and you gained a good understanding of its structure (in Chapter 2, Preparing for Analysis – Data Cleansing and Manipulation), but do you have an idea of its, let's say, appearance?
Do you know how data is related to itself? Do any correlations exist?
If you want to model your phenomenon with accuracy and effectiveness, you have to know the answers to these questions. This is where basic data visualization comes in handy. This includes plotting your variables against one another, looking for correlations, understanding relations (or absence of relations) without losing yourself in hundreds of lines of code.
In this chapter, we will do all of this mainly using base R and ggplot2
, which is the data visualization package that lets you produce plots by applying the grammar of graphics and has become a standard of R dataviz.
Besides basic data visualizations recipes, some goodies are also provided...