设为首页 加入收藏

TOP

转载Quandl R Package(二)
2017-10-10 12:10:10 】 浏览:5990
Tags:转载 Quandl Package
ed. For example, to download the database ZEA:

Quandl.database.bulk_download_to_file("ZEA", "./ZEA.zip")

Note you must set your api key to download premium databases to which you are subscribed.

For a full list of optional query parameters for downloading an entire database, click here.

Datatables

To retrieve Datatable data, provide a Datatable code to the Quandl datatables function:

data = Quandl.datatable('ZACKS/FC')

The output format is data.frame. Given the volume of data stored in datatables, this call will retrieve the first page of the ZACKS/FC datatable. You may turn on pagination to return more data by using:

data = Quandl.datatable('ZACKS/FC', paginate=TRUE)

This will retrieve multiple pages of data and merge them together as if they were one large page. In some cases, however, you will still exceed the request limit. In this case we recommend you filter your data using the available query parameters, as in the following example:

Quandl.datatable('ZACKS/FC', ticker=c('AAPL', 'MSFT'), per_end_date.gt='2015-01-01', qopts.columns=c('ticker', 'per_end_date', 'tot_revnu'))

In this query we are asking for more pages of data, ticker values of either AAPL or MSFT and a per_end_date that is greater than or equal to 2015-01-01. We are also filtering the returned columns on ticker, per_end_date and tot_revnu rather than all available columns.

Searching Quandl from within the R console is now supported. The search function is:

Quandl.search(query = "Search Term", page = n, database_code = "Specific database to search", silent = TRUE|FALSE)
  • query: Required; Your search term, as a string
  • page: Optional; page number of search you wish returned, defaults to 1.
  • per_page: Optional; number of results per page, defaults to 10 in the Quandl R package.
  • database_code: Optional; Name of a specific source you wish to search, as a string
  • silent: Optional; specifies whether you wish the first three results printed to the console, defaults to True (see example below).

Which outputs to console a list containing the following information for every item returned by the search:

  • Name
  • Quandl code
  • Description
  • Frequency
  • Column names

Example

A search for Oil, searching only the National Stock Exchange of India (NSE).

Quandl.search("Oil", database_code = "NSE", per_page = 3)

prints:

Oil India Limited
Code: NSE/OIL
Desc: Historical prices for Oil India Limited<br><br>National Stock Exchange of India<br><br>Ticker: OIL<br><br>ISIN: INE274J01014
Freq: daily
Cols: Date | Open | High | Low | Last | Close | Total Trade Quantity | Turnover (Lacs)

Oil Country Tubular Limited
Code: NSE/OILCOUNTUB
Desc: Historical prices for Oil Country Tubular Limited<br><br>National Stock Exchange of India<br><br>Ticker: OILCOUNTUB<br><br>ISIN: INE591A01010
Freq: daily
Cols: Date | Open | High | Low | Last | Close | Total Trade Quantity | Turnover (Lacs)

Gulf Oil Corporation Limited
Code: NSE/GULFOILCOR
Desc: Historical prices for Gulf Oil Corporation Limited (GULFOILCOR), (ISIN: INE077F01027),  National Stock Exchange of India.
Freq: daily
Cols: Date | Open | High | Low | Last | Close | Total Trade Quantity | Turnover (Lacs)

Additional Resources

More help can be found at Quandl in our R and API pages.

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇R语言和机器学习---重要网站分享 下一篇R语言-基础解析

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目