【发布时间】:2016-08-01 16:42:43
【问题描述】:
我不明白如何在 R 中创建时间序列对象。
我有数据:data = c(101,99,97,95,93,91,89,87,85,83,81)(为简洁起见,数据集较小)。
从2016-07-05 到2016-07-15,每天采集一次此数据,持续 11 天。根据docs,每天采样数据的频率应该是7。但我不明白start和end参数的值。对于start,文档说:
the time of the first observation. Either a single number or a vector of two integers, which specify a natural time unit and a (1-based) number of samples into the time unit. 我不明白 1-based number of samples 是什么意思。我试图用谷歌搜索它,但它没有帮助。
如果我只使用2016,7 作为开始和结束日期,我会得到:
Time Series:
Start = c(2016, 7)
End = c(2016, 7)
Frequency = 7
[1] 101
如果我使用2016,7,1 和2016,7,11 作为开始和结束日期,我仍然会得到相同的输出。
我做错了什么?
【问题讨论】:
标签: r time-series