How to transform wide to long data

Hi @Fenny and welcome to the RStudio Community :partying_face: :partying_face: :partying_face: :partying_face: :partying_face:

Transforming wide to long data is actually fairly simple to do in R. In order to better serve you, we would need you to make your question reproducible. That is to say that rather than a picture of your dataset, it would help us get the actual data which you can share with us this way:

  • import the data to your current R session (in a variable called my_data for example)
  • execute: dput(my_data)
  • copy and paste the output here.

You may want to look at this great article to learn how to ask a reproducible question:FAQ: How to do a minimal reproducible example ( reprex ) for beginners

Having said that, if you want to figure it out yourself, you can look into the pivot_longer() function in the tidyr package. But if you share your data, we will be able to provide you with actual code.