Transform data from wide to long format using R

Often, when we input data into a spreadsheet, we use the wide format where the sequence of variables are ordered according to the columns. But when we perform longitudinal analyses, we need to transform this to the long format.

Sometimes, I forget how to do this in R, so I decided to write a tutorial to remind myself how to do this.

Therefore, I wrote a tutorial on using the pivot_longer() function to transform data from the wide to long format in preparation for longitudinal data analysis. The tutorial is located on my RPubs page.