tidyr
packagepivot_longer()
pivot_wider()
separate()
unite()
Since there will be no live coding session this week, no script is provided. Instead, you will learn about tidying data by self-studying the textbook.
This week we will go through chapter 12 in the R4DS textbook.
The most important thing to understand this week is pivoting
(pivot_longer()
and pivot_wider()
). The
concept of pivoting is rather straight-forward, but I think a
visualization of the process can be helpful when first learning about
these methods. Therefore, I created an animation going through the
different steps of pivot_longer()
and it can be found here.
Feel free to complete all exercises in chapter 12 of the textbook. During the Tuesday homework session we will however focus on the following exercises: