I have data, which looks like this:
These data are only for one subject. I will have a lot more.
These data will be analyzed in R.
Now I'm storing them like this:
subject <- rep(1, times = 24)
measurement <- factor(x = rep(x = 1:3, each = 8),
labels = c("Distance", "Frequency", "Energy"))
speed <- factor(x = rep(x = 1:2, each = 4, times = 3),
labels = c("speed1", "speed2"))
condition <- factor(x = rep(x = 1:2, each = 2, times = 6),
labels = c("Control", "Experm"))
Try <- factor(x = rep(x = 1:2, times = 12),
labels = c("Try1", "Try2"))
result <- c(1:8,
11:18,
21:28)
dt <- data.frame(subject, measurement, speed, condition, Try, result)
What is the appropriate way to store these data in R (in a data frame)?