【发布时间】:2019-02-08 21:57:58
【问题描述】:
我正在尝试在闪亮的应用程序中使用 quantmod 绘制股票图表,但出现以下错误:两次尝试后 input$stockInput 下载失败。错误消息:HTTP 错误 404。感谢任何帮助。
服务器:
library(quantmod)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
price <- getSymbols('input$stockInput',from='2017-01-01')
plot(price)
})})
用户界面:
library(shiny)
shinyUI(fluidPage(
titlePanel("Stock Chart"),
sidebarLayout(
sidebarPanel(
#This is a dropdown to select the stock
selectInput("stockInput",
"Pick your stock:",
c("AMZN","FB","GOOG","NVDA","AAPL"),
"AMZN"),selected = "GOOG"),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
))))
谢谢。
【问题讨论】: