TSdbi

R-forge
Summary Page
Source Code
Repository
R-Forge
Packages
Contact
Project Admin
TSdbi Home

CRAN Packages

Related Packages
Data from the Internet

(If you are interested in becoming a developer on these projects, please contact the project administrator.)

TSsdmx is a wrapper for package RJSDMX. Additional information about the underlying package is available at the wiki. SDMX is an XML time series data format supported by several large international organizations (OECD, Eurostat, the ECB, the IMF, the UN, the BIS, the Federal Reserve Board, the World Bank, the Italian Statistics agency, ...). It has become the most complete interface and may soon replace all others.

TSmisc provides wrappers for several different functions including: getSymbols in package quantmod, which can retrieve data from Yahoo, Google, Oanda and the U.S. Federal Reserve FRED database among others; get.hist.quote in package tseries which can get stock prices from Yahoo and Oanda; read.xls in package gdata reads series from a spreadsheet, either in a local file or from the Internet; and zip which downloads zipped comma separated value files, unzips them and extracts the series data, for example exchange rate data from pitrading.com (no affiliation).

TSjson gets time series data from the source, and imports it to R using Javascript object notation (JSON). Fetching the data is done using a script with Python mechanize to automatically click through web pages to get a file to downloaded. It does not use a real API to the data server (although it could if the server implements support). For this reason TSjson should be considered a temporary solution, until the data server implements a proper API. The Python scripts are not generic, there needs to be a customized script for a specific site. Currently, only a Statistics Canada connection is supported. This package will be phased out when Statistics Canada implements SDMX/REST. It has been archived on CRAN and is only available from this R-forge site.

TSjson package supports two mechanisms for contacting the web data source. The first calls a Python script distributed with the package. This requires that the R client machine can run Python 2 and has several Python modules installed (mechanize, sys, json, re, csv, urllib2), which are all usually in the default Python library, or installed with python-mechanize. On most systems, including Windows, install can be done by going to the directory of the unzipped package that contains the file setup.py and at the command prompt running "python setup.py install". It will also be necessary have python on your PATH so the program can be found. On many Linux systems these modules are available with the debian package python-mechanize (sudo apt-get install python-mechanize). Details and more general install instructions are provided in the README file distributed with the package.

Since installing software may be difficult in some environments, a second mechanism uses an intermediate proxy portal to the real web source data server. The proxy retrieves and relays the data. This requires setting up an HTTP server somewhere on the Internet, which must have Python and the modules installed, but on the R client machine only R and the TSjson package are required. The server can require user identification and a password.