我正在尝试data.table
使用以下结构写入磁盘 a:
类“data.table”和“data.frame”:408776 obs。13 个变量: $日期:IDate,格式:“2013-02-01”“2013-02-01”“2013-02-01”“2013-02-01”... $小时:int 1 1 1 1 1 1 2 2 2 2 ... $时间:类'ITime'int [1:408776] 16 186 218 229 463 474 16 186 208 218 ... $bids_med : 数字 NA NA NA 2.1 2.1 4.6 NA 7.5 7.5 7.5 ... $bids_n:int NA NA NA 2 2 2 NA 4 4 4 ... $ asks_med : 数 NA NA NA 21.5 21.5 21.5 NA 21 21 21 ... $ asks_n:int NA NA NA 2 2 2 NA 5 5 5 ... $ bprice:num 5 4.2 4.2 4.2 5 5 9 9 9 10 ... $ 数量:int 19 10 10 10 5 5 25 25 50 20 ... $ aprice : 数字 16 16 21 21 21 21 19 19 19 19 ... $ 数量:int 25 6 50 50 50 50 50 50 50 50 ... $ lastprice: num 7 16 16 16 16 16 9 9 9 9 ... $ lastqty : int 31 19 6 6 6 6 25 25 25 25 ... - attr(*, "sorted")= chr "日期" "小时" "时间" - attr(*, ".internal.selfref")=
我收到以下错误:
> write.csv(“数据/probit.csv”,培训,row.names = FALSE) charToDate(x) 中的错误: 字符串不是标准的明确格式
重现:
结构(列表(日期 = 结构(c(15737L,15737L,15737L,15737L, 15737L, 15737L), 类 = c("IDate", "Date")), 小时 = c(1L, 1L, 1L, 1L, 1L, 1L), 时间 = 结构(c(16L, 186L, 218L, 229L, 463L, 474L), 类 = "ITime"), bids_med = c(NA, NA, NA, 2.1, 2.1, 4.6 ), bids_n = c(NA, NA, NA, 2L, 2L, 2L), asks_med = c(NA, NA, NA, 21.5, 21.5, 21.5), asks_n = c(NA, NA, NA, 2L, 2L, 2L), bprice = c(5, 4.2, 4.2, 4.2, 5, 5), bqty = c(19L, 10L, 10L, 10L, 5L, 5L), aprice = c(16, 16, 21, 21, 21, 21), aqty = c(25L, 6L, 50L, 50L, 50L, 50L), lastprice = c(7, 16, 16, 16, 16, 16), lastqty = c(31L, 19L, 6L, 6L, 6L, 6L)), .Names = c("日期", “小时”、“时间”、“bids_med”、“bids_n”、“asks_med”、“asks_n”、“bprice”、 "bqty", "aprice", "aqty", "lastprice", "lastqty"), sorted = c("date", "小时", "时间"), 类 = c("data.table", "data.frame"), row.names = c(NA, -6L))
我很迷茫该怎么办。有什么建议可能有帮助吗?谢谢。