我有一个tbl_df文件,它有两个变量和476个观察结果:

> str(file)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   476 obs. of  2 variables:
 $ date: Date, format: "2017-02-06" "2017-02-07" "2017-02-08" "2017-02-09" ...
 $ Vol : num  362610 346201 320025 332272 393183 ...
 - attr(*, "spec")=List of 2
  ..$ cols   :List of 2
  .. ..$ date:List of 1
  .. .. ..$ format: chr "%d/%m/%Y"
  .. .. ..- attr(*, "class")= chr  "collector_date" "collector"
  .. ..$ Vol : list()
  .. .. ..- attr(*, "class")= chr  "collector_double" "collector"
  ..$ default: list()
  .. ..- attr(*, "class")= chr  "collector_guess" "collector"
  ..- attr(*, "class")= chr "col_spec"

> head(file)
# A tibble: 6 x 2
  date           Vol
  <date>       <dbl>
1 2017-02-06 362610.
2 2017-02-07 346201.
3 2017-02-08 320025.
4 2017-02-09 332272.
5 2017-02-10 393183.
6 2017-02-11 420278.

我希望对我的时间序列进行季节性分解,这是每日记录的网络吞吐量 .

enter image description here

我创建了一个名为x的变量,它是一个时间序列,频率为476,因为476/1 = 476,其中一个表示每个时间单位的观测数 .

x <- ts(file$Vol, frequency = 476)
stl(x, s.window = "periodic")
Error in stl(x, s.window = "periodic") : 
  series is not periodic or has less than two periods

str(x)
 Time-Series [1:476] from 1 to 2: 362610 346201 320025 332272 393183 ...

我已经指定了变量的频率,所以我很困惑为什么R说数据的周期性小于2.任何人都可以看到我正在做的任何问题,并指出我哪里出错了? Here是我正在使用的文件的输入 .