I need to reshape my data (a subset as below) from wide to long format. I have tried reshape() and pivot_longer(), but I could not make what I need. I have added the part of output of long format I would like to make. I really appreciate your help.
structure(list(id = c(1, 2, 3, 4), g6m = c("12", "11", "16.9",
"17.1"), g12m = c("18", "11", "11.1", "19.5"), g18m = c("29",
"11.6", "12.3", "17"), g24m = c("12", "13.6", "10", "11"), age = c(45,
37, 51, 47), gender = c(0, 1, 0, 1), ms = c("11.136", "12.18",
"19.01", "10.01")), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-4L))
