6 Wrangling data
Before creating a figure or a table (see next chapter), data often needs to be manipulated to create variables that are suitable for display. When doing data-intensive work, you will spend most of your time wrangling data. That is, transform, summarise, and describe variables and their relationships. In this chapter, we will introduce R functions that are useful for data wrangling.
6.1 To pipe or not to pipe?
In the previous chapter we used the ggplot function to initialize