df45 = data.frame(
Tag = c(1,1,1,1,1,2,2,2,2,2),
clus = c("L1","L2","L3","L4","L5","L1","L2","L3","L4","L5"),
long = runif(1:10,1,2),
medium = runif(1:10,1,2),
short = runif(1:10,1,2),
urgent = runif(1:10,1,2))
here is the data i am trying to pivot .
This is the expected Output is shown image ,To start of with i tried with below code but i am unable achieve the required result.
melt(df45 , id.var = "Tag")