Step-by-step lesson · RStudio
How to reshape data with tidyr in RStudio
- Type library(tidyr)
- Type long <- pivot_longer(data, cols = c(t1, t2), names_to = "time", values_to = "score")
- Type head(long) to check
- Use pivot_wider to go back
More in RStudio
- How to run code in the console and in a script in RStudio
- How to install and load a package in RStudio
- How to make a plot with ggplot2 in RStudio
- How to filter and select data with dplyr in RStudio
- How to run a t-test in RStudio
- How to set the working directory in RStudio