2017-10-15 4 views
0

나는 회사의 증권 시세 표시를 입력으로 사용하고 quantmod 패키지의 다양한 기능을 활용하여 특정 정보 (손익 계산서, 현금 흐름, 기타.). "오류 : 기능을 찾을 수 없습니다."컨테이너. "반짝이는 오류의 대부분은 어딘가에 닫는 대괄호를 사용하지 않아서 발생하는 것으로 알고 있지만 그럴 것 같지 않습니다. 의 라벨이없는R - Shiny가 "컨테이너"를 찾을 수 없음

library(shiny) 
shinyServer(function(input, output) { 
     library(quantmod) 
     change_ticker <- reactive(function() { 
      ticker <- input$ticker 
      adj_ticker <- getFin(ticker) 
      financial <- get(adj_ticker) 
      financial 
     })  
     output$last_price <- renderTable(
      getQuote(ticker) 
    ) 
     output$annual_bs <- renderText(
      viewFinancials(financial, type = "BS", period = "A") 
    ) 
     output$annual_cf <- renderText(
      viewFinancials(financial, type = "CF", period = "A") 
    ) 
     output$annual_is <- renderText(
      viewFinancials(financial, type = "IS", period = "A") 
    ) 
     output$quarter_bs <- renderText(
      viewFinancials(financial, type = "BS", period = "Q") 
    ) 
     output$quarter_cf <- renderText(
      viewFinancials(financial, type = "CF", period = "Q") 
    ) 
     output$quarter_is <- renderText(
      viewFinancials(financial, type = "IS", period = "Q") 
    ) 
}) 

답변

1

textOutput server.R. 어떤 도움 감사합니다. 주위를 연주 할 때 전에이 오류에

ui.R

library(shiny) 
shinyUI(
     fluidPage(
      titlePanel("Should You Invest"), 
      sidebarLayout(
        sidebarPanel(h3("How It Works"), 
         "You input the ticker symbol of a company, and this app returns the 
         Net Current Asset Value per Share, otherwise known as Grahams Rule", 
         textInput("ticker", 
            "Company Ticker", 
            placeholder = "AAPL"), 
         submitButton("Submit"), 
         textOutput("last_price", 
            "Last Traded Price"), 
         textOutput("NCAVPS", 
            "Net Current Asset Value per Share") 
       ), 
        mainPanel(
         tabsetPanel(type = "pills", 
            tabPanel("Annual", 
              tabsetPanel(type = "tabs", 
                 tabPanel("Balance Sheet", 
                    textOutput("annual_bs")), 
                 tabPanel("Cash Flow", 
                    textOutput("annual_cf")), 
                 tabPanel("Income Statement", 
                    textOutput("annual_is")) 
                ) 
            ), 
            tabPanel("Quarter", 
              tabsetPanel(type = "tabs", 
                 tabPanel("Balance Sheet", 
                    textOutput("quarter_bs")), 
                 tabPanel("Cash Flow", 
                    textOutput("quarter_cf")), 
                 tabPanel("Income Statement", 
                    textOutput("quarter_is")) 
                ) 
            )   
         ) 
       ) 
      ) 
    ) 
) 

를 실행하므로이하지 않은 작동하지 않음 :

textOutput("last_price", 
      "Last Traded Price"), 
textOutput("NCAVPS", 
      "Net Current Asset Value per Share") 

두 번째 인수는 HTML 컨테이너를 생성하는 container 함수입니다. 라벨은 별개 여야합니다. 예 :

div(
    tags$b("Last Traded Price"), 
    textOutput("last_price") 
) 
관련 문제