R 在';行不通
我在玩shiny,无法让最简单的动作按钮示例工作 第一个例子如下: 下面是代码,这是从网站复制粘贴R 在';行不通,r,shiny,shiny-server,R,Shiny,Shiny Server,我在玩shiny,无法让最简单的动作按钮示例工作 第一个例子如下: 下面是代码,这是从网站复制粘贴 #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 shiny
#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 })
})
#ui.R
shinyUI(fluidPage)(
#复制下面的行以创建操作按钮
actionButton(“action”,label=“action”),
hr(),
fluidRow(第2列,逐字输出(“值”))
))
#服务器.R
shinyServer(功能(输入、输出){
#您可以通过输入$action访问小部件的值,例如。
输出$value如果希望它看起来像网站上的那样,请使用renderText
而不是renderPrint
:
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 })
})
)
require(闪亮)
runApp(列表(ui=fluidPage(
actionButton(“action”,label=“action”),
hr(),
fluidRow(第2列,逐字输出(“值”))
)
,服务器=功能(输入,输出){
输出$value对我来说似乎有效。每次按下按钮计数器都会递增