Working with datatables in Quandl
In the previous exercises you used your Quandl skills to pull in time-series data. In this exercise you will learn how to make a call from R to pull in a datatable (which is used for non-time-series data).
Quandl supports two data formats: time-series and "datatables". Make sure to look to each database’s documentation to determine which format it employs.
An example: To get all rows for ZACKX/FC where ticker is AAPL
you just do Quandl.datatable("ZACKS/FC", ticker="AAPL")
. If you only want specific columns you add qopts.columns="ticker"
and this returns just the ticker for AAPL
.
This exercise is part of the course
How to work with Quandl in R
Exercise instructions
- Retrieve all rows from ZACKS/FC for
AAPL
(Apple) andMSFT
(Microsoft). Assign the result todatatable_all
. - Do the same as in the previous instruction, but this time only return the
ticker
andper_end_date
columns. Assign the result todatatable_columns
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Retrieve all rows for ZACKS/FC for 'AAPL' and 'MSFT'
datatable_all <- ___
# Retrieve all rows for ZACKS/FC for 'AAPL' and 'MSFT'. Only return the ticker and per_end_date columns
datatable_columns <- ___