我没有renderText的输出

我没有renderText的输出,r,shiny,wiki,R,Shiny,Wiki,我正在开发r闪亮的界面,但我被一些基本的功能(如renderText)阻挡了,我的界面上什么都没有 我有几种方法:比如textOutput和renderText,但我最后一次尝试是paste0,但遗憾的是它不起作用 library(shiny) if (interactive()) { ui <- fluidPage( numericInput("gdat10", "Gold difference at 10:00", ""), numericInput("gda

我正在开发r闪亮的界面,但我被一些基本的功能(如renderText)阻挡了,我的界面上什么都没有

我有几种方法:比如textOutput和renderText,但我最后一次尝试是paste0,但遗憾的是它不起作用


library(shiny)

if (interactive()) {

  ui <- fluidPage(
    numericInput("gdat10", "Gold difference at 10:00", ""),
    numericInput("gdat15", "Total gold earned at 15:00", ""),
    numericInput("fb", "First blood kill", ""),
    numericInput("teamkills", "Total kills by team", ""),
    numericInput("teamdeaths", "Total deaths by team", ""),
    numericInput("ft", "First tower of game killed", ""),numericInput("teamdragkills", "Total dragons killed by team", ""),
    numericInput("oppdragkills", "Total dragons killed by opposing team", "")
  )

  server <- function(input, output) {



    output$txtOutput = renderText({
    paste0("The result is ", 1/1+exp(0.9241448 +input$gdat10*0.0003145+input$gdat15*  -0.0005429 
                  + input$fb*-0.5025296+input$teamkills* 0.2768595+ input$teamdeaths* -0.2684347 
                  +input$ft*-1.7174641 +input$teamtowerkills*0.9032026 +input$opptowerkills*-0.9241948
                  +input$fd *0.3033756 +input$teamdragkills*0.1530605+input$oppdragkills*-0.1426903) ) })
  }
  shinyApp(ui, server)
}



图书馆(闪亮)
if(interactive()){

ui用这个替换当前的ui

更新了@phalteman对缺失输入的观察结果

ui <- fluidPage(
 numericInput("gdat10", "Gold difference at 10:00", ""),
 numericInput("gdat15", "Total gold earned at 15:00", ""),
 numericInput("fb", "First blood kill", ""),
 numericInput("teamkills", "Total kills by team", ""),
 numericInput("teamdeaths", "Total deaths by team", ""),
 numericInput("ft", "First tower of game killed", ""),
 numericInput("fd", "First dragon of game killed", ""),
 numericInput("teamdragkills", "Total dragons killed by team", ""),
 numericInput("oppdragkills", "Total dragons killed by opposing team", ""),
 numericInput("teamtowerkills", "Total tower killed by team", ""),
 numericInput("opptowerkills", "Total tower killed by opposing team", ""),
 textOutput('txtOutput')
)

ui服务器中的等式中也使用了一些输入,但ui中没有提供这些输入,在计算任何参数之前需要删除这些输入。很高兴听到这些。如果它有效,请接受答案。感谢您的回答,它非常有效。请编写一个函数来接受这些参数