Introducing tidyverse and dplyr
One of the most widely used R libraries that contains a set of individual packages is tidyverse
; it includes dplyr
and ggplot2
(to be covered in Chapter 4). It can support most data processing and visualization needs and comes with an easy and fast implementation compared to base R commands. Therefore, it is recommended to outsource a specific data processing or visualization task to tidyverse
instead of implementing it ourselves.
Before we dive into the world of data processing, there is one more data structure that’s used in the ecosystem of tidyverse
: tibble
. A tibble
is an advanced version of a DataFrame and offers much better format control, leading to clean expressions in code. It is the central data structure in tidyverse
. A DataFrame can be converted into a tibble
object and vice versa. Let’s go through an exercise on this.
Exercise 2.01 – converting between tibble and a DataFrame
First, we will explore the tidyverse...