[英]Download stock data from yahoo into R shiny based on user input
Got a problem how to download data into R shiny. 遇到问题如何将数据下载到R Shiny中。
I have created a selectInput
list with stock symbols like AAPL
, MCD
, MMM
and so on with button Download data. 我创建了一个带有股票符号(如
AAPL
, MCD
, MMM
等)的selectInput
列表,并带有按钮Download data。
And I need to based on user input when is selected let's say AAPL
to fetch the data from yahoo and ie create a chart. 我需要根据用户输入的时间来选择
AAPL
以便从yahoo获取数据并创建图表。
I'm using pdfetch_YAHOO()
function to get the data. 我正在使用
pdfetch_YAHOO()
函数获取数据。
Can anyone give a hand? 谁能帮忙?
Well, I think Yahoo turned off it's API that did this back in May of 2017. Here is an alternative way of downloading historical time series prices for equities. 好吧,我认为Yahoo在2017年5月关闭了执行此操作的API。这是下载股票历史时间序列价格的另一种方法。
library(quantmod)
e <- new.env()
getSymbols("IBM;MSFT", env = e)
pframe <- do.call(merge, as.list(e))
head(pframe)
Also... 也...
require(quantmod)
getSymbols(c("MSFT", "AAPL", "GOOGL"), auto.assign = TRUE, from = "2005-01-05",src="google")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.