我已经下载了一个使用闪亮的示例,我想向其中添加一个简单的技术指标。
我的问题是我无法真正看到第二张图。有什么帮助建议吗? 我读过这个:在闪亮 和 R闪亮的两个tabPanels中绘制相同的输出:如何将相同的图分配给两个不同的plotOutput 我做的完全相同或至少我认为。所以我需要一点帮助,请
library(shiny)
ui <- shinyUI(fluidPage(
titlePanel("Simple Stock Charting App"),
sidebarLayout(
sidebarPanel(
textInput("symb", label = h3("Input a Valid Stock Ticker"), value = "GE")
),
### uncomment for dygraphs chart
mainPanel(dygraphOutput("plot")),
mainPanel(plotOutput("plot2"))
)
))
library(quantmod)
library(dygraphs)
library(TTR)
server <- shinyServer(function(input, output) {
dataInput <- reactive({
prices <- getSymbols(input$symb, auto.assign = FALSE)
})
output$plot <- renderDygraph({renderPlot
prices <- dataInput()
dygraph(Ad(prices)) %>%
dyRangeSelector()
})
output$plot2 <- renderPlot({
prices <- dataInput()
prices <- Ad(prices)
plotOutput((RSI(prices, n = 14))) …Run Code Online (Sandbox Code Playgroud)