Statistiek: introductie tot R


4. The tidyverse
14 oktober 2020 23:00

Up to now we have been manipulating vectors by reordering and subsetting them through indexing. However, once we start more advanced analyses, the preferred unit for data storage is not the vector but the data frame. In this chapter we learn to work directly with data frames, which greatly facilitate the organization of information. We will be using data frames for the majority of this book. We will focus on a specific data format referred to as tidy and on specific collection of packages that are particularly helpful for working with tidy data referred to as the tidyverse.

We can load all the tidyverse packages at once by installing and loading the tidyverse package:

library(tidyverse)

We will learn how to implement the tidyverse approach throughout the book, but before delving into the details, in this chapter we introduce some of the most widely used tidyverse functionality, starting with the dplyr package for manipulating data frames and the purrr package for working with functions. Note that the tidyverse also includes a graphing package, ggplot2, which will be introduced in a later course on data visualization, the readr package discussed in Chapter 5; and many others. In this chapter, we first introduce the concept of tidy data and then demonstrate how we use the tidyverse to work with data frames in this format.

Titel Voortgang groep
4.1 Tidy data
4.2.1 CO2
4.2.2 Weight
4.2.3 BOD
4.3 Manipulating data frames
4.4.1-3. Dataframe column operations
4.4.4-6. Dataframe row operations
4.4.7. Dataframe mixed operations
4.5 The pipe: %>%
4.6.1 Pipes
4.7 Summarizing data
4.8 Sorting data frames
4.9.1. Summarizing
4.9.2. Grouping
4.9.3. Sorting
4.10 Tibbles
4.11 The dot operator
4.12 do
4.13 The purrr package
4.14 Tidyverse conditionals
4.15.1. Tibbles 1
4.15.2. Tibbles 2
4.15.3. Purrr