2017-09-21 8 views
0

光沢を使用した例をダウンロードしました。簡単な技術的な指標を追加したいと思います。光沢のある建物2グラフがもう1つ下にあります

私の問題は、実際には2番目のグラフが見えないことです。 ヘルプがありますか? Plotting the same output in two tabPanels in shiny R Shiny: How to assign the same plot to two different plotOutput 私はまったく同じか、少なくとも私は思います: は、私はこの読んだことがあります。だから私はこの

enter image description here

答えて

2

-OUTPUT

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))) %>% dyRangeSelector() 

      }) 
    }) 


    shinyApp(ui,server) 
2

は、最初はdygraphであると仮定すると、2つ目の通常1

library(shiny) 
library(quantmod) 
library(dygraphs) 
library(TTR) 

ui <- shinyUI(fluidPage(titlePanel("Simple Stock Charting App"), 

             sidebarLayout(
              sidebarPanel(

              textInput("symb", label = h3("Input a Valid Stock Ticker"), value = "GE") 
             ), 


              mainPanel(fluidRow(dygraphOutput("plot"), 
                plotOutput("plot2"))) 
             ) 
)) 


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) 
    plot(prices) 

    }) 
}) 


shinyApp(ui,server) 

、その上の小さな助けが必要がありますしてください必要があります仕事をする

library(shiny) 
library(quantmod) 
library(dygraphs) 
library(TTR) 
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"),plotOutput("plot2")) 
) 
)) 


server <- shinyServer(function(input, output) { 

    dataInput <- reactive({ 
    prices <- getSymbols(input$symb, auto.assign = FALSE) 
    }) 

    output$plot <- renderDygraph({renderPlot 
    dygraph(Ad(dataInput())) %>%dyRangeSelector() 
    }) 

    output$plot2 <- renderPlot({ 
    plot((RSI(Ad(dataInput()), n = 14))) 
    }) 
}) 


shinyApp(ui,server) 

enter image description here

関連する問題