I'm trying to convert this wide format
into
I tried this code
test <- Gil.Q4 %>%
select(id, x1:z3) %>%
gather(n1, grade, x1, y1, z1) %>%
gather(n2, grade, x2, y2, z2) %>%
gather(n3, grade, x3, y3, z3)
But it is not working. Please help