【发布时间】:2020-03-22 15:35:34
【问题描述】:
您好,我是 r shiny 的新手,我正在尝试创建一个应用程序来绘制 r 中 quantmod 中的股票 像这样
这是我的代码
library(shiny)
server = function(input, output, session) {
output$plot <- renderPlot({
data <- getSymbols(input$stock,
from = input$date[1],
to = input$date[2]
)
chartSeries(data, theme = chartTheme("white"),
type = "line", log.scale = input$log, TA = NULL)
})
} # the server
ui = basicPage(
h1("stock app"),
textInput("stocks", "pick stock"),
dateRangeInput("date", "date range ", start = "2013-01-01", end = "2020-03-15",min = "2007-01-01", max = "2020-03-15",format = "yyyy-mm-dd" ),
plotOutput("plot")
) # the user interface
shinyApp(ui = ui, server = server) # perform app launch
但是,我的应用程序没有绘制股票系列,而是返回了这样的错误
错误:chartSeries 需要一个 xtsible 对象。
我想知道为什么我的应用程序没有在我的输入中绘制股票
【问题讨论】: