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.
本练习是课程的一部分
Forecasting Product Demand in R
练习说明
Create three objects called
MET_hi,MET_lo, andMET_spfrom the three columnsMET.hi,MET.lo, andMET.sprespectively from your xts objectbev_xts.Sum these three regions sales together into one object called
MET_t.Plot the
MET_tobject to visualize the sales of the metropolitan region of the state.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# 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)