0

I have my data in the wide-format

enter image description here

what is the easiest way to change it to long

enter image description here

Sample data:

structure(list(X1 = c("01/12/2019", "02/12/2019"), `00:30` = c(41.95, 
39.689), `01:00` = c(44.96, 40.47), `01:30` = c(42.939, 38.95
), `02:00` = c(43.221, 40.46), `02:30` = c(44.439, 41.97)), class = "data.frame", row.names = c(NA, 
-2L), spec = structure(list(cols = list(X1 = structure(list(), class = c("collector_character", 
"collector")), `00:30` = structure(list(), class = c("collector_double", 
"collector")), `01:00` = structure(list(), class = c("collector_double", 
"collector")), `01:30` = structure(list(), class = c("collector_double", 
"collector")), `02:00` = structure(list(), class = c("collector_double", 
"collector")), `02:30` = structure(list(), class = c("collector_double", 
"collector"))), default = structure(list(), class = c("collector_guess", 
"collector")), skip = 1L), class = "col_spec"))
Rstudent
  • 825
  • 2
  • 12
  • 1
    You're not going from wide to long in the traditional sense, here you are transposing your data. Basically you are just flipping the rows and columns. – MrFlick Oct 22 '21 at 21:32

0 Answers0