Loading data into xts object

Forecasting Product Demand in R

Aric LaBarr, Ph.D.

Senior Data Scientist, Elder Research

xts objects

  • eXtensible Time Series object
  • Builds upon zoo objects
Forecasting Product Demand in R

Loading Data Into xts Object

  • Attach a date index on to a data matrix
  • Very easy to manipulate!

Forecasting Product Demand in R

DataCamp courses about xts

Forecasting Product Demand in R

Loading Data Example

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
Forecasting Product Demand in R

Let's practice!

Forecasting Product Demand in R

Preparing Video For Download...