简体   繁体   English

无法在动物园中读取时间序列

[英]Unable to read time series in zoo

I have a text file with two columns.The First contains dates in format mm/dd/yyyy and the second column has data.There is also a header row. 我有一个带有两列的文本文件。第一列包含日期格式为mm / dd / yyyy的日期,第二列包含数据,还有一个标题行。 A snippet is below: 以下是一个摘要:

Date       Premium  
3/23/2011   32  
3/22/2011   32  
3/21/2011   33  

The series is irregular as on some dates data was not collected. 该系列是不规则的,因为在某些日期没有收集数据。 The no. 没有 of rows is close to 2500. I want to do some Time Series work on such series. 的行数接近2500。我想对此类序列进行一些时间序列工作。

However,when i type the following code, error shows up. 但是,当我键入以下代码时,会出现错误。

x<-read.zoo(file.choose(),header=TRUE,format="/%m//%d//%Y")

The error is: 错误是:

Error in read.zoo(file.choose(), header = TRUE, index.column = 1, format = "/%m//%d//%Y") :   
  index has 2490 bad entries at data rows: 1 2 3 4 5..  etc etc

Please help me in getting it correct. 请帮助我纠正它。

格式应为:format = "%m/%d/%Y"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM