【发布时间】:2014-07-23 18:05:31
【问题描述】:
我的数据如下所示:
Date department_id position_id totala Weekday start_Time Date Month Year
7/12/2014 7487 126476 218.39 5 956 12 7 2014
7/7/2014 7487 126476 270.28 7 855 7 7 2014
7/8/2014 7487 126476 247.83 1 810 8 7 2014
7/9/2014 7487 126476 191.16 2 959 9 7 2014
7/9/2014 7487 126476 191.16 2 627 9 7 2014
........
当我尝试将其转换为时间序列数据时,它给了我这个错误:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
str (ant):
'data.frame': 29 obs. of 5 variables:
**$ Date : Factor w/ 12 levels "6/29/2014","6/30/2014",..: 5 10 11 12 12 4 9 8 7 3** ...
$ department_id: int 7487 7487 7487 7487 7487 7487 7487 7487 7487 7487 ...
$ position_id : int 126476 126476 126476 126476 126476 126476 126476 126476 126476 126476 ...
$ totala : num 218 270 248 191 191 ...
$ start_Time : int 956 855 810 959 627 864 630 742 948 623 ...
【问题讨论】:
-
as.Date("7/12/2014", format="%d/%m/%Y") 。输出:“2014-12-07”
标签: r time-series