Exercise

Plot the price data

R has powerful graphical capabilities. On the right, the Starbucks closing prices are plotted as a function of time. This plot was generated with plot(sbux_df$Adj.Close), the basic plotting function (more info in the documentation of plot).

However, we should be able to generate a nicer plot, right? For one thing, a line plot makes much more sense for price time series data.

Instructions

100 XP

Let us make a better plot by adding the following arguments to the plot() function: type = "l" specifies a line plot, col = "blue" indicates that the line should be blue, lwd = 2 doubles the line thickness, ylab = "Adjusted close" adds a y-axis label and main = "Monthly closing price of SBUX" adds a title.