Let me start out by saying I am a complete beginner. So please bear with me if I lack the most basic terminology
Here's what I am trying to do:
test <- read.table(text = "Tube Window Session Value
A 1 1 13
A 1 2 14
B 1 1 17
B 1 2 14", header = TRUE)
to
result <- read.table(text = "Window Session Tube.A.Value Tube.B.Value
1 1 13 17
1 2 14 14", header = TRUE)
I searched for a bit and found the tidyr
package. I am fairly certain that its spread()
function is what I am looking for, but I can't get it to do what I need.