【发布时间】:2020-04-10 22:34:11
【问题描述】:
我有一个数据集,df:
Action Date
Begin 3/16/2020 12:35:47 PM
End 3/16/2020 12:35:49 PM
Begin 3/16/2020 01:35:47 PM
End 3/16/2020 01:35:49 PM
期望的结果:
Begin End
3/16/2020 12:35:47 PM 3/16/2020 12:35:49 PM
3/16/2020 01:35:47 PM 3/16/2020 01:35:49 PM
输入:
structure(list(Action = structure(c(1L, 2L, 1L, 2L), .Label = c("Begin",
"End"), class = "factor"), Date = structure(c(3L, 4L, 1L, 2L), .Label = c("3/16/2020 1:35:47 PM",
"3/16/2020 1:35:49 PM", "3/16/2020 12:35:47 PM", "3/16/2020 12:35:49 PM"
), class = "factor")), class = "data.frame", row.names = c(NA,
-4L))
我尝试过的:
I think this is a permute type problem, but not exactly sure.
Permute(df, invertdf=FALSE)
任何建议都有帮助。
【问题讨论】: