Section 11 The Tidyverse
The Tidyverse (Wickham et al. 2019), (Wickham 2019b) is a collection of R packages designed for data science.
(Artwork by @allison_horst)
We’ll be using tidyverse packages quite a lot from now on. Install the package with the command
When you run the command
this will load the packages ggplot2, dplyr, tidyr, readr, purr, tibble, stringr, forcats
. There are other packages included in the tidyverse installation which need loading explicitly if you want to use them, e.g. readxl
.
If you want to use the ::
syntax with a ‘tidyverse
function’, you have to know which package within the tidyverse the
function belongs to. For example, the command
library(tidyverse)
will enable you to use the
read_csv()
command, but this command is actually part of
the readr
package within the tidyverse, so the correct
syntax would be readr::read_csv()
, not
tidyverse::read_csv()
.