2017-11-30 16 views
1

私はチームメイトから、RShinyアプリケーションのサーバー側を完了する必要がないことをアプリのUI側に表示するように教えてくれました。Appの実行中にShinyのUI側が表示されない

ここに私のコードのビットがあります:

ui <- dashboardPage(
dashboardHeader(title = "Enrolment Analytics"), 
dashboardSidebar(sidebarMenu(

#can change tab names and icons here. 
menuItem("Summary Tables", tabName = "Summary Tables", icon = icon("table")), 
menuItem("Visualizations", tabName = "Visualizations", icon = icon("line-chart")) 

) 
), 

dashboardBody(
tabItems(
tabItem(tabName = "Summary Tables", 
     fluidRow(
      box(title = "Teaching Load ", status = "primary", solidHeader = TRUE, 
       selectInput("courseCode1", "Course code: ", 
          choices = as.list(unique(data1$discipline))), 
       numericInput("Month", "1 = January, 2 = February, ..., 12 = December", value = 6), 
       numericInput("Year", "2007, 2008, ..., 2017", value = 2007) 
      ), 
      box(title = "Summary ", status = "primary", solidHeader = TRUE, 
       plotOutput("tl1")) 
     )) 
), 

tabItem(tabName = "Visualizations", 
     fluidRow(
      box(title = "Teaching Load", status = "primary", solidHeader = TRUE, 
       selectInput("courseCodeOne", "First discipline: ", 
          choices = as.list(unique(data1$discipline))), 
       selectInput("courseCodeTwo", "Second discipline: ", 
          choices = as.list(unique(data1$discipline))), 
       selectInput("courseCodeThree", "Third discipline: ", 
          choices = as.list(unique(data1$discipline))) 
      ), 
      box(title = "Teaching Load Graph", status = "primary", solidHeader = TRUE, 
       plotOutput("tl2")) 
     )) 
) 
) 

私はアプリを実行すると、サイドバーが視覚化し、サマリー表を示していますが、物事のサーバー側で、唯一の可視化ボックスが表示とサマリー表が行いますない。

答えて

0

あなたのコードには2つの問題がありました:

1)tabNameは、ヘルプページから明確ではないスペースを()を含めることはできません。 。

2)あなたはこれら二つのミスを修正する場合は、tabItemのかっこ内に含まれていなかったtabItem(第2ブラケットエラー

を持っていた、UIが正常に動作している:

ui <- dashboardPage(
    dashboardHeader(title = "Enrolment Analytics"), 
    dashboardSidebar(sidebarMenu(

    #can change tab names and icons here. 
    menuItem("Summary Tables", tabName = "SummaryTables", icon = icon("table")), 
    menuItem("Visualizations", tabName = "Visualizations", icon = icon("line-chart")) 

) 
), 

    dashboardBody(
    tabItems(
     tabItem(tabName = "SummaryTables", 
       fluidRow(
       box(title = "Teaching Load ", status = "primary", solidHeader = TRUE, 
        selectInput("courseCode1", "Course code: ", 
           choices = 1:5), 
        numericInput("Month", "1 = January, 2 = February, ..., 12 = December", value = 6), 
        numericInput("Year", "2007, 2008, ..., 2017", value = 2007) 
       ), 
       box(title = "Summary ", status = "primary", solidHeader = TRUE, 
        plotOutput("tl1")) 
      )), 
    ## BRACKET ERROR WAS HERE 

    tabItem(tabName = "Visualizations", 
      fluidRow(
       box(title = "Teaching Load", status = "primary", solidHeader = TRUE, 
        selectInput("courseCodeOne", "First discipline: ", 
           choices = 1:10), 
        selectInput("courseCodeTwo", "Second discipline: ", 
           choices = 1:10), 
        selectInput("courseCodeThree", "Third discipline: ", 
           choices = 1:10) 
      ), 
       box(title = "Teaching Load Graph", status = "primary", solidHeader = TRUE, 
        plotOutput("tl2")) 
      ) 
    ) 
)) 
) 
server = function(input, output, session){ 

} 
shinyApp(ui, server) 

enter image description here

関連する問題