的确是帮助文档不够详细的问题。帮助文档里给出了 最后一个参数是 (...)
这里告诉你查找过程。
getSymbols 函数定义如下:
- function (Symbols = NULL, env = parent.frame(), reload.Symbols = FALSE,
- verbose = FALSE, warnings = TRUE, src = "yahoo", symbol.lookup = TRUE,
- auto.assign = getOption("getSymbols.auto.assign", TRUE),
- ...)
复制代码
对于这里的 src 参数帮助中说:
Current src methods available are: yahoo, google, MySQL, FRED, csv, RData, and oanda.
src :character string specifying sourcing method. (yahoo)
其实 getSymbols 是内部调用了对应的 sourcing method,分别是:
- getSymbols.FRED Download Federal Reserve Economic Data -
- FRED(R)
- getSymbols.MySQL Retrieve Data from MySQL Database
- getSymbols.SQLite Retrieve Data from SQLite Database
- getSymbols.csv Load Data from csv File
- getSymbols.google Download OHLC Data From Google Finance
- getSymbols.oanda Download Currency and Metals Data from
- Oanda.com
- getSymbols.rda Load Data from R Binary File
- getSymbols.yahoo Download OHLC Data From Yahoo Finance
复制代码
传递给 getSymbols 的多余参数,都会直接用来调用这些 sourcing method. 这里默认是 yahoo
所以查看 ``getSymbols.yahoo`` 帮助:
- Usage
- getSymbols.yahoo(Symbols,
- env,
- return.class = 'xts',
- index.class = 'Date',
- from = "2007-01-01",
- to = Sys.Date(),
- ...)
- Arguments
- Symbols
- a character vector specifying the names of each symbol to be loaded
- env
- where to create objects. (.GlobalEnv)
- return.class
- class of returned object
- index.class
- class of returned object index (xts only)
- from
- Retrieve data no earlier than this date. (2007-01-01)
- to
- Retrieve data through this date (Sys.Date())
- ...
- additional parameters
复制代码