Exercise

Visualize your vector

Time to try something a bit different. So far, you have been programming in the script, and looking at your data by printing it out. For a more informative visualization, try a plot!

For this exercise, you will again be working with some Apple stock data. This time it contains the prices for all of December, 2016.

The plot() function is one of the many ways to create a graph from your data in R. Passing in a vector will add its values to the y-axis of the graph, and on the x-axis will be an index created from the order that your vector is in.

Inside of plot(), you can change the type of your graph using type =. The default is "p" for points, but you can also change it to "l" for line.

Instructions

100 XP

apple_stock has already been defined, and everything has been set up for you. Try running the script line-by-line using Command + Enter on Mac or Control + Enter on Windows while clicked on each line.