我有下面的字符向量
a = c("2009-07-31 18:00:33", "2009-07-31 18:00:38", "2009-07-31 18:00:43", "2009-07-31 18:00:49", "2009-08-01 01:58:49", "2009-08-01 01:53:16", "2009-08-01 08:04:13", "2009-08-01 16:16:13")
我想将其转换为时间对象,所以我这样做:
b = strptime(a, "%Y-%m-%d %H:%M:%S")
为什么 a 和 b 的长度不同?
> length(a)
[1] 8
> length(b)
[1] 9