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

install.packages("tidyverse")

When you run the command

library(tidyverse)

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().

References

———. 2019b. Tidyverse: Easily Install and Load the ’Tidyverse’. https://CRAN.R-project.org/package=tidyverse.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.