---
title: Data transformation
author: David Kane
tutorial:
  id: data-transformation
output:
  learnr::tutorial:
    progressive: yes
    allow_skip: yes
runtime: shiny_prerendered
description: 'Tutorial for Chapter 4: Data transformation'
---

```{r setup, include = FALSE}
library(learnr)
knitr::opts_chunk$set(echo = FALSE)
options(tutorial.exercise.timelimit = 60, 
        tutorial.storage = "local") 
```

```{r copy-code-chunk, child = system.file("child_documents/copy_button.Rmd", package = "tutorial.helpers")}
```

```{r info-section, child = system.file("child_documents/info_section.Rmd", package = "tutorial.helpers")}
```

<!-- There are plenty of exercises in this chapter. We could add them here or make another tutorial: `data-transformation-exercises`. -->

<!-- This help page --- https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html --- has lots of great stuff. <Should find a way to mention lots of items from this help page throughout this tutorial, maybe in the select() questions.  -->

## Introduction
### 

This tutorial covers [Chapter 4: Data transformation](https://r4ds.hadley.nz/data-transform.html) from [*R for Data Science (2e)*](https://r4ds.hadley.nz/) by Hadley Wickham, Mine Çetinkaya-Rundel, and Garrett Grolemund. You will learn about the key functions from the [**dplyr**](https://dplyr.tidyverse.org/) package for working with data including `[filter()](https://dplyr.tidyverse.org/reference/filter.html)`,  `[arrange()](https://dplyr.tidyverse.org/reference/arrange.html)`, `[select()](https://dplyr.tidyverse.org/reference/select.html)`, `[mutate()](https://dplyr.tidyverse.org/reference/mutate.html)`, and `[summarize()](https://dplyr.tidyverse.org/reference/summarise.html)`.

The goal of this chapter is to give you an overview of all the key tools for transforming a data frame. We’ll start with functions that operate on rows and then columns of a data frame, then circle back to talk more about the pipe, an important tool that you use to combine verbs.



## Summary
### 

This tutorial covered [Chapter 4: Data transformation](https://r4ds.hadley.nz/data-transform.html) from [*R for Data Science (2e)*](https://r4ds.hadley.nz/) by Hadley Wickham, Mine Çetinkaya-Rundel, and Garrett Grolemund. You learned about the key functions from the [**dplyr**](https://dplyr.tidyverse.org/) package for working with data including [`filter()`](https://dplyr.tidyverse.org/reference/filter.html),  [`arrange()`](https://dplyr.tidyverse.org/reference/arrange.html), [`select()`](https://dplyr.tidyverse.org/reference/select.html), [`mutate()`](https://dplyr.tidyverse.org/reference/mutate.html), and [`summarize()`](https://dplyr.tidyverse.org/reference/summarise.html).


<!-- Something about janitor::clean_names()` perhaps? Maybe: https://cran.r-project.org/web/packages/janitor/vignettes/janitor.html-->

```{r download-answers, child = system.file("child_documents/download_answers.Rmd", package = "tutorial.helpers")}
```
