【发布时间】:2017-11-18 13:34:58
【问题描述】:
我有一些看起来像这样的数据:
dates <- structure(c(1L, 2L, 4L, 3L), .Label = c("Sat, 18 Nov 2017 00:00:00 GMT",
"Thu, 16 Nov 2017 00:00:00 GMT", "Tue, 14 Nov 2017 00:00:00 GMT",
"Wed, 15 Nov 2017 00:00:00 GMT"), class = "factor")
我想将其转换为日期格式,而不是将其作为一个因素。另外,我想去掉格林威治标准时间 00:00:00,因为它没有意义
我尝试了lubridate,但我遇到了格式问题:
library(lubridate)
mdy(dates)
Warning message:
All formats failed to parse. No formats found.
【问题讨论】: