Skip to content

Instantly share code, notes, and snippets.

#Wide data frame has three time points where participants answer two questions on two topics.
#Needs to become a long data frame for time, but independent columnsfor topic and question.
#The clunky way to do this is my solution below. Is there a more efficient solution?
library(dplyr)
library(tidyr)
#Simmed data
Time1.Topic1.Question1 <- rnorm(500)
data <- data.frame(Time1.Topic1.Question1)
data$Time1.TOpic1.Question2 <- rnorm(500)