0

私は光沢のあるもので遊んでいますが、最も単純なアクションボタンの例を機能させることができません.

ここにある最初の例: http://shiny.rstudio.com/gallery/widgets-gallery.html

以下は、ウェブサイトからのコピーペーストであるコードです。

#ui.R
shinyUI(fluidPage(

  # Copy the line below to make an action button
  actionButton("action", label = "Action"),

  hr(),
  fluidRow(column(2, verbatimTextOutput("value")))

))


#server.R
shinyServer(function(input, output) {

  # You can access the value of the widget with input$action, e.g.
  output$value <- renderPrint({ input$action })

})

私は次のようになります: http://imgur.com/t0Vx6Wr

編集:問題は、いくつかのクラス情報も出力することですありがとう

4

1 に答える 1

1

ウェブサイトのように見せたい場合renderTextは、むしろ次のように使用します。renderPrintshiny

require(shiny)
runApp(list(ui = fluidPage(
  actionButton("action", label = "Action"),
  hr(),
  fluidRow(column(2, verbatimTextOutput("value")))
)
, server = function(input, output) {
  output$value <- renderText({ input$action })  
})
)

ここに画像の説明を入力

于 2014-07-02T14:39:29.237 に答える