【发布时间】:2023-03-18 03:53:01
【问题描述】:
我想下载历史调整后的收盘价并将它们保存在同一个 DataFrame 中
这是我的尝试
library('quantmod')
start <- as.Date("2017-01-01")
end <- as.Date("2017-10-27")
tickers = c('AAPL','TSLA')
i=1
data <- getSymbols(tickers, src = "yahoo", from = start, to = end)
data
for (i in length(tickers)) {
data <- getSymbols(tickers[i], src = "yahoo", from = start, to = end)
Data <- as.data.frame(tickers[i])
Data <- Data[6] #6 is the column of the adjusted price
i=i+1
}
我怎样才能做到这一点?
提前谢谢你
【问题讨论】: