将数据加载到 xts 对象中

使用 R 预测产品需求

Aric LaBarr, Ph.D.

Senior Data Scientist, Elder Research

xts 对象

  • 可扩展的时间序列对象
  • 基于 zoo 对象构建
使用 R 预测产品需求

将数据加载到 xts 对象

  • 为数据矩阵附加日期索引
  • 非常易于操作!

使用 R 预测产品需求

关于 xts 的 DataCamp 课程

使用 R 预测产品需求

加载数据示例

dates <- seq(as.Date("2014-01-19"), length = 176, 
                                    by = "weeks")

bev_xts <- xts(bev, order.by = dates)
head(bev_xts[,"M.hi"], n = 3)
            M.hi
2014-01-19  458
2014-01-26  477
2014-02-02  539
使用 R 预测产品需求

让我们来练习!

使用 R 预测产品需求

Preparing Video For Download...