2017-04-24 7 views
1

RShiny Webアプリケーションの1ページに2つのテーブルを挿入しようとしています。 私が書いた:2ページを1ページに表示

shinyApp(
    shinyUI(tableOutput('table1'), 
      tableOutput('table2')), 
    shinyServer(function(input, output){ 
    output$table1 <- renderTable(mtcars) 
    output$table2 <- renderTable(iris) 
    }) 
) 

しかし、それは私に以下のようにエラーメッセージを与えている:

shinyUIでエラーが発生しました(tableOutput( "TABLE1")、tableOutput( "表2")):未使用
を引数(tableOutput( "table2"))

テーブル1またはテーブル2のみを印刷すると、正常に機能するため、わかりません。同時に2つのテーブルを同時に印刷しようとすると、「未使用の引数」エラーが発生します。

このエラーはなぜ発生しますか? この問題を解決するにはどうすればよいですか?ありがとうございました。

+0

これはshinydashboardパッケージでははるかに簡単です。それを見てみましょう。 –

答えて

0

これはうまくいくはずです。

library(shiny) 

ui <- fluidPage(
    tableOutput('table1'), 
    tableOutput('table2') 
) 

server <- function(input, output, session) { 
    output$table1 <- renderTable(mtcars) 
    output$table2 <- renderTable(iris) 
} 

shinyApp(ui, server) 
関連する問題