Chapter 2: Data Transformation

This chapter introduces the basic concepts of R tidyverse syntax such as filter, select, mutate, summarise and more importantly how to use the pipe operator %>%.

1Introduction

2Exercise: A look at the gapminder data frame object

3The filter() function

4Exercise: Practice with filter()

5The select() function

6Exercise: Practice with select()

7The mutate() function

8Exercise: Practice with mutate()

9The summarise() function

10Exercise: Practice with summarise()

11The pipe operator %>%

12Exercise: Practice with the pipe operator %>%

13Pivot Longer or Pivot Wider

14Exercise: Practice pivot

15Conclusion

About this course

This tutorial uses contents and examples from the following free online books. They are perfect for beginners, feel free to check them out for further information: R for Data Science by Wickham and Grolemund (2017), A ModernDive into R and the tidyverse by Ismay and Kim (2019), Learning statistics with R by Navarro (2019), Introduction to Open Data Science by the Ocean Health Index Team (2019), Getting Used to R, RStudio, and R Markdown by Kennedy (2019) and Statistical Thinking for the 21st Century by Poldrack (2020).

About me

Ph.D in Social and Experimental Psychology from the University Grenoble-Alpes, France, my researches are focusing on understanding psycho-physiological responses ‘in the wild’. Now Assistant Professor of Business Research Methods at Dublin City University, my domain of expertise relies on multivariate time series analysis and trend extraction for supervised or unsupervised machine learning classification.