I have following data in R:
structure(list(Name = 1:4, Paper1 = c("C1", "C1", "C1", "C1"),
Marks1 = 1:4, Paper2 = c("D1", "D1", "D1", "D1"), Marks2 = 1:4,
Paper3 = c("E1", "E1", "E1", "E1"), Marks3 = 12:15), class = "data.frame", row.names = c(NA, -4L))
I want to arrange my data like this:
structure(list(Name = c(1L, 1L, 1L, 2L, 2L, 2L), Paper = c("C1",
"D1", "E1", "C1", "D1", "E1"), Marks = c(1L, 1L, 12L, 2L, 2L,
13L)), class = "data.frame", row.names = c(NA, -6L))
I tried, shape
, melt
, but both are not providing desired output. Please suggests the solution.