【发布时间】:2014-03-01 09:12:18
【问题描述】:
我想开始学习如何使用 xts 包,但我很难加载我的数据。
文件大约 6MB,看起来像这样:
Date,Time,Price,Size
02/18/2014,05:06:13,49.6,200
02/18/2014,05:06:13,49.6,200
02/18/2014,05:06:13,49.6,200
02/18/2014,05:06:14,49.6,200
02/18/2014,05:06:14,49.6,193
02/18/2014,05:44:41,49.62,100
02/18/2014,06:26:36,49.52,100
02/18/2014,06:26:36,49.52,500
02/18/2014,07:09:29,49.6,100
02/18/2014,07:56:40,49.56,300
02/18/2014,07:56:40,49.55,400
02/18/2014,07:56:41,49.54,200
02/18/2014,07:56:43,49.55,100
02/18/2014,07:56:43,49.55,100
02/18/2014,07:56:50,49.55,100
02/18/2014,07:57:12,49.53,100
02/18/2014,07:57:12,49.51,2200
02/18/2014,07:57:12,49.51,100
02/18/2014,07:57:12,49.5,200
这是我尝试的代码行和我得到的错误:
data1<-as.xts(read.zoo("EKSO_0.txt",header = T,sep=",",format="%m/%d/%Y"))
我得到的错误:
Warning message:
In zoo(rval3, ix) :
some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
如何加载“时间”列?
感谢您的帮助。
【问题讨论】:
-
我想你会想要加载第 1 列和第 2 列来创建日期时间索引。那么您将不会收到该警告。