【问题标题】:Shiny inbuilt programs are throwing error闪亮的内置程序抛出错误
【发布时间】:2016-04-11 17:38:24
【问题描述】:

我正在尝试使用闪亮(通过 runExample() 方法)运行内置程序(示例)并收到以下错误。

输出$DynamicAssets 中的错误

其他程序也会出现此错误。 例如,这是捕获用户输入的详细信息的代码:

ui.R

library(shiny)
shinyUI(fluidPage(
  titlePanel("Enter Personal Details"),
  sidebarLayout(
    sidebarPanel(("Enter the personal Details"),
                 textInput("name","Enter your name", ""),
                 textInput("age","Enter your age","")
                 ),
    mainPanel(("Your Entered information is : "),
                textOutput("myname"),
                textOutput("myage")
              )
    )
  )
)

服务器.R

library(shiny)
shinyServer(
  function(input,output){
    output$myname= renderText(input$name)
    output$myage=renderText(input$age)

  }
)

仍然显示相同的错误... 编辑:输出->输出

【问题讨论】:

  • 如果理解正确,您尝试运行示例吗?运行它们的正确方法是:library(shiny) runExample("01_hello")
  • 是的,我正在尝试运行示例,是的,我添加了库,但仍然出现无响应的 Web 显示(带有灰色窗口,通常是应用程序被终止时的情况)以及已经提到的错误.. @MikaelJumppanen
  • 不要在Output$myname中使用大写字母并尝试output$myname <- renderText(input$name)
  • 仅从它开始,但没有运气...@MikaelJumppanen 和示例也没有响应:/

标签: r shiny data-analysis


【解决方案1】:

这段代码应该可以工作:

library(shiny)
server <- function(input, output) {
  output$myname <- renderText(input$name)
  output$myage <- renderText(input$age)


}

ui <- fluidPage(titlePanel("Enter Personal Details"),
                sidebarLayout(
                  sidebarPanel(("Enter the personal Details"),
                               textInput("name", "Enter your name", ""),
                               textInput("age", "Enter your age", "")
                  ),
                  mainPanel(("Your Entered information is : "),
                            textOutput("myname"),
                            textOutput("myage")
                  )
                ))

shinyApp(ui = ui, server = server)      

如果它不起作用,问题就出在代码之外的其他地方。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-24
    • 2016-02-24
    • 1970-01-01
    • 2017-03-24
    • 1970-01-01
    • 2021-01-09
    相关资源
    最近更新 更多