2017-01-07 1 views
1

私は、データの特定の週をプロットするために時系列をウィンドウにしようとしています。しかし、私はここで、次のエラーメッセージRの時系列をウィンドウで表示する際のエラー

Error in .window.timeSeries(x, start, end, ...) : 
    .window.timeSeries is for time series and not for signal series. 
In addition: There were 30 warnings (use warnings() to see them) 

を受け、再現例です。

library(timeSeries) 
TimeDate <- c("15-Jun-04/09","15-Jun-04/19","16-Jun-04/05") 
Northwest <- c("898", "893", "948") 
NorthwestSeries <- timeSeries(Northwest, TimeDate, format="%Y/%m/%d/%H") 
week.N <- series(window(NorthwestSeries, 
       start=timeDate("15-Jun-04-09",format="%d-%b-%y-%H"),    
       end=timeDate("16-Jun-04-05",format="%d-%b-%y-%H"))) 

が、私はこれをどのように修正することができます!

+0

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-examplあなたのquestinoを再現可能にする方法についてe – csgillespie

+0

アドバイスをいただきありがとうございます! – user2058291

+0

私はNorthwest2010がNorthwestSeriesであると推測しますか? – csgillespie

答えて

0

あなたの日付と時刻の形式が適切ではない、と私は、これらのフォーマットを変更しました:

NorthwestSeries <- timeSeries(Northwest, TimeDate, format="%y-%b-%d/%H") 
week.N <- series(window(NorthwestSeries, 
       start=timeDate("15-Jun-04-09",format="%y-%b-%d/%H"),    
       end=timeDate("16-Jun-04-05",format="%y-%b-%d/%H"))) 

y - 月の名前の省略形

から2桁

bと年H - 24時間形式の時間

+0

ありがとう! formatパラメータに関するドキュメントはどこにありますか? (Rドキュメントは、window関数のtimeSeriesパッケージではそれほど広範ではありません) – user2058291

+0

これは '?strptime'のように単純です。 –

関連する問題