1. Learn
  2. /
  3. Courses
  4. /
  5. How to work with Quandl in R

Exercise

Plotting a stock chart

The Quandl package is able to return data in 4 very usable formats:

  • data frame ("raw"),
  • ts ("ts"),
  • zoo ("zoo") and
  • xts ("xts")

The only thing you have to do is give the type you want as an argument to the Quandl() function.

Suppose you want to plot the end of day stock price of Facebook (Use Quandl code: WIKI/FB), with the help of the quantmod package. This package requires you to use the xts format.

Instructions

100 XP
  • Assign the Facebook stock quotes to the variable Facebook. Do not forget to indicate to use the xts type.
  • The quantmod package is already loaded. Use candleChart to plot the graph.