我不知道如何弄清楚这个问题.这是我的df的一部分:
structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("B0", "B1", "B12", "B2", "B21", "B22", "B26",
"B3", "B33", "B4", "B7", "P1", "P21", "P24", "P24 ", "P25", "P27",
"P28", "P29"), class = "factor"), Date = structure(c(9839, 9946,
10045, 10133, 10190, 10302, 10354, 10423, 10528, …Run Code Online (Sandbox Code Playgroud)