Session Ready
Exercise

Return data type

The Quandl() function returns a data.frame by default. It can return other classes via the type argument.

The possible values for type are:

  1. "raw" (a data.frame),
  2. "ts" (time-series objects from the stats package),
  3. "zoo",
  4. "xts", and
  5. "timeSeries" (from the timeSeries package in the RMetrics suite).

In this exercise, you will learn how to use the type argument to make Quandl() return an xts and a zoo object.

The Quandl package has already been loaded for you.

Instructions
100 XP
  • Use the type argument to make Quandl() import the GDP data as a xts object. Assign the result to gdp_xts.
  • Use str() to view the structure of gdp_xts.
  • Use the type argument to make Quandl() import the GDP data as a zoo object. Assign the result to gdp_zoo.
  • Use str() to view the structure of gdp_zoo.