1

I am trying to window a time series to plot a particular week of data. However I receive the following error message

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)

Here is a reproducible example:

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")))

How can I fix this!

user2058291
  • 107
  • 3
  • 10

1 Answers1

0

Your time and date format is not right, and I've changed those format to:

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 - for year with 2 digits

b - abbreviation of month name

H - hour in 24Hours format

Sixiang.Hu
  • 1,009
  • 10
  • 21