I'm a newbie on R following a PDF of timeseries analysis with R, by Walter Zucchini. I have some data coming from a sensor, in particular I can have data every minutes or every 5 seconds.
Then I want to use ts()
command to make a time series of those values. So the syntax should be data1mints <- ts(data1min ,freq = 525600)
where 525600 are the minutes in a regular year.
after that I try to plot with this command plot(stl(log(data1min), s.window = "periodic"))
but R says me that
series is not periodic or has less than two periods
To be more precise, I have data from 20 March to 28 March, so i didn't have a complete year data, but I think it's a enough period to analyze what happens every minute.
What I'm wrong?
The error message tells you what is wrong - you have less than 2 periods.
For example,