历史是很困难的。R的quantmod包有getQuote,它与yahooQF一起是获得当前值所需的全部内容。在require("quantmod")
getQuote("GS", what = yahooQF(c("Market Capitalization", "Earnings/Share",
"P/E Ratio", "Book Value", "EBITDA", "52-week Range")))
Trade Time Market Capitalization Earnings/Share P/E Ratio Book Value EBITDA 52-week Range
GS 2012-06-21 04:00:00 47.870B 6.764 14.27 134.476 0 84.27 - 139.25
还有,试试看
^{pr2}$
这将为您提供一个菜单,用于选择要请求的字段。在
您可以使用getFinancials从Google Finance获得最近的财务报表
还有一个FinancialInstrument包,它有几个update_instruments.*函数来下载有关仪器(本例中是股票)的元数据。例如,以下是yahoo one的功能require("FinancialInstrument")
stock("GS", currency("USD")) # define the stock
#[1] "GS"
update_instruments.yahoo("GS") #update with yahoo
#[1] "GS"
getI