DataSets - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : DataSets Package : DataSets/Reference

DataSets

 Reference
 create a reference to a data set

 Calling Sequence Reference(source, id)

Parameters

 source - string; name of the source, which is one of "Quandl" or "Builtin" id - string; identifier of the data set

Description

 • The Reference command creates a reference to a data set and retrieves metadata about the data available for the data set. It returns a Reference object.
 • The corresponding data can then be retrieved by converting the object to a suitable data structure. The data structures supported differ from reference to reference, but Matrix is always supported.
 • For more information, see the Reference object help pages for data coming from particular data sources (for example, Quandl or Builtin).

Examples

 > $\mathrm{with}\left(\mathrm{DataSets}\right):$

Create a Quandl data set.

 > $\mathrm{qdata}≔\mathrm{Reference}\left("Quandl","FRED/CANPOPL"\right)$
 ${\mathrm{qdata}}{≔}\left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Population in Canada}}\\ {\mathrm{Quandl FRED/CANPOPL}}\\ {\mathrm{up to 52 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-01-01 - 2011-01-01}}\end{array}\right]$ (1)

Create a Builtin data set.

 > $\mathrm{bdata}≔\mathrm{Reference}\left("Builtin","Country"\right)$
 ${\mathrm{bdata}}{≔}\left[\begin{array}{ccccc}{\mathrm{Country \left(Name\right)}}& {\mathrm{CO2 Emissions}}& {\mathrm{CPI Change}}& {\dots }& {\mathrm{\left(124 more\right)}}\\ {\mathrm{Afghanistan}}& {\mathrm{TimeSeries 12251.447}}& {\mathrm{TimeSeries 7.6476076230378}}& {\dots }& {}\\ {\mathrm{Albania}}& {\mathrm{TimeSeries 4668.091}}& {\mathrm{TimeSeries 1.6285401210224}}& {\dots }& {}\\ {\mathrm{Algeria}}& {\mathrm{TimeSeries 121755.401}}& {\mathrm{TimeSeries 2.9164064126589}}& {\dots }& {}\\ {⋮}& {⋮}& {⋮}& {\ddots }& {}\\ {\mathrm{\left(182 more\right)}}& {}& {}& {}& {}\end{array}\right]$ (2)

Convert to a Matrix.

 > $\mathrm{convert}\left(\mathrm{qdata},'\mathrm{Matrix}'\right)$
 $\left[\begin{array}{c}{\mathrm{52 x 2}}{\mathrm{Matrix}}\\ {\mathrm{Data Type:}}{\mathrm{anything}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (3)
 > $\mathrm{convert}\left({\mathrm{bdata}}_{1..3,1..3},'\mathrm{Matrix}'\right)$
 $\left[\begin{array}{cccc}{"Afghanistan"}& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Afghanistan: CO2 emissions \left(kt\right)}}\\ {\mathrm{Quandl WORLDBANK/AFG_EN_ATM_CO2E_KT}}\\ {\mathrm{up to 52 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-12-31 - 2011-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Afghanistan: Inflation, consumer prices \left(annual %\right)}}\\ {\mathrm{Quandl WORLDBANK/AFG_FP_CPI_TOTL_ZG}}\\ {\mathrm{up to 9 rows \left(annual\right), 1 column}}\\ {\mathrm{2005-12-31 - 2013-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Afghanistan: Mortality rate, under-5 \left(per 1,000 live births\right)}}\\ {\mathrm{Quandl WORLDBANK/AFG_SH_DYN_MORT}}\\ {\mathrm{up to 54 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-12-31 - 2013-12-31}}\end{array}\right]\\ {"Albania"}& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Albania: CO2 emissions \left(kt\right)}}\\ {\mathrm{Quandl WORLDBANK/ALB_EN_ATM_CO2E_KT}}\\ {\mathrm{up to 52 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-12-31 - 2011-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Albania: Inflation, consumer prices \left(annual %\right)}}\\ {\mathrm{Quandl WORLDBANK/ALB_FP_CPI_TOTL_ZG}}\\ {\mathrm{up to 23 rows \left(annual\right), 1 column}}\\ {\mathrm{1992-12-31 - 2014-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Albania: Mortality rate, under-5 \left(per 1,000 live births\right)}}\\ {\mathrm{Quandl WORLDBANK/ALB_SH_DYN_MORT}}\\ {\mathrm{up to 36 rows \left(annual\right), 1 column}}\\ {\mathrm{1978-12-31 - 2013-12-31}}\end{array}\right]\\ {"Algeria"}& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Algeria: CO2 emissions \left(kt\right)}}\\ {\mathrm{Quandl WORLDBANK/DZA_EN_ATM_CO2E_KT}}\\ {\mathrm{up to 51 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-12-31 - 2010-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Algeria: Inflation, consumer prices \left(annual %\right)}}\\ {\mathrm{Quandl WORLDBANK/DZA_FP_CPI_TOTL_ZG}}\\ {\mathrm{up to 45 rows \left(annual\right), 1 column}}\\ {\mathrm{1970-12-31 - 2014-12-31}}\end{array}\right]& \left[\begin{array}{c}{\mathrm{Data set}}\\ {\mathrm{Algeria: Mortality rate, under-5 \left(per 1,000 live births\right)}}\\ {\mathrm{Quandl WORLDBANK/DZA_SH_DYN_MORT}}\\ {\mathrm{up to 54 rows \left(annual\right), 1 column}}\\ {\mathrm{1960-12-31 - 2013-12-31}}\end{array}\right]\end{array}\right]$ (4)

Compatibility

 • The DataSets[Reference] command was introduced in Maple 2015.