1.18 R tidyverse
In this book, we will start by learning how to carry out data management tasks using base R, but there will also be examples that use the tidyverse. You really need to know base R, but also knowing how to use the tidyverse can make many tasks much easier.
All of the code in previous sections used only base R. The functions in the tidyverse
package (Wickham et al. 2019; Wickham 2023b) will be used a lot in Chapters 3 and 4 for managing variables and datasets.
For now, we will just introduce an object type that is unique to the tidyverse. A tibble
is a type of data.frame
used specifically in the tidyverse set of packages. A tibble
has multiple classes: tbl_df
and data.frame
, so it can be handled like a data.frame
but also in has some special features unique to the class tbl_df
.
If you have not already done so, then install the tidyverse
package.
When you need to use functions in the tidyverse
, load the library.