I got rows that are laid out as follows:
I would like this data to be turned into:
I have not tried anything myself yet in R because all I can think of is iterating over the frame in a loop and my guess is that there are more effective methods in R. Would any of you know haw this can be achieved effectively?
To those requiring a working sample here is @Ronack's method to generate it:
df = structure(list(Date = c("23-10-2019", "24-10-2019"),
`30s` = c(3, 2),
`40s` = c(2, 1)),
class = "data.frame", row.names = c(NA, -2L))