How can I decompose a time series of daily frequency in R? I have the number of visitors to a website each day over the course of a year. I want to show a graph of the weekly season.
my_data = read.csv("time series test.csv", header = TRUE)
my_zoo_ts = read.zoo("time series test.csv", sep = ",", format="%m/%d/%y")
stl(my_zoo_ts)
# Error in stl(coerced_ts) :
# series is not periodic or has less than two periods
I was hoping to use STL, but apparently STL can't be used with daily data (from another S.O. question).
Here is the head of my data.
head(my_data)
V1 V2
1 1/1/14 123
2 1/2/14 128
3 1/3/14 129
4 1/4/14 130
5 1/5/14 137
6 1/6/14 141
stl
cannot be used with"Date"
class data. The data must be regularly spaced and one period must have the duration of 1. – G. Grothendieckzoo
that is just a single vector regularly spaced. But I can't figure out how to specify the period to be 1 week. – Don P