I have a data frame that i want to transpose (i suppose transpose is the correct word). The code below will give a simplified Data frame.
tests <- c("TestA", "TestB", "TestC")
bg <- c(23, 13, 15)
s1 <- c(21,15,17)
s2 <- c(27,25,11)
s3 <- c(24,14,18)
df <- data.frame(tests,bg,s1,s2,s3)
I want to transpose/ reshape this to have the following structure:
Please keep in mind that there could be up to 20 tests, and 50 series (s1, s2....s50)