Get startedGet started for free

Plotting / visualizing data

In the videos we are working with the mountain region of the beverage data. Here in the exercises you will be working with the metropolitan areas of the state to forecast their products.

There are three products in the metropolitan areas - high end, low end, and specialty. The specialty product is not sold any where else in the state. The column names for the sales of these three products are MET.hi, MET.lo, and MET.sp respectively. Before looking at each one of these products individually, let's plot how total sales are going in the metropolitan region. The object bev_xts has been preloaded into your workspace.

This exercise is part of the course

Forecasting Product Demand in R

View Course

Exercise instructions

  • Create three objects called MET_hi, MET_lo, and MET_sp from the three columns MET.hi, MET.lo, and MET.sp respectively from your xts object bev_xts.

  • Sum these three regions sales together into one object called MET_t.

  • Plot the MET_t object to visualize the sales of the metropolitan region of the state.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create the individual region sales as their own objects
MET_hi <- bev_xts[,"MET.hi"]
MET_lo <- bev_xts[,"___"]
MET_sp <- ___[,"___"]

# Sum the region sales together
MET_t <- ___ + ___ + ___

# Plot the metropolitan region total sales
plot(MET_t)
Edit and Run Code