从输入字段

时间:2017-12-31 12:43:21

标签: r shiny

我有这样一个闪亮的应用程序:

library(shiny)


UI <- fluidPage(
  numericInput("obs", "Observations:", 10, min = 1, max = 100),
  numericInput("obs", "Observations:", 10, min = 1, max = 100)
)
Server <- function(input, output) {}

shinyApp(ui = UI, server = Server)

如果我删除这样的标题:

UI <- fluidPage(
  numericInput("obs", "", 10, min = 1, max = 100),
  numericInput("obs", "", 10, min = 1, max = 100)
)
Server <- function(input, output) {}

shinyApp(ui = UI, server = Server)

我仍然在输入字段上方浮动空白区域。关于我如何摆脱这种想法的任何想法?

1 个答案:

答案 0 :(得分:3)

如果您想要空字段,请使用NULL作为标签:

library(shiny)
UI <- fluidPage(
    numericInput("obs", "Observations:", 10, min = 1, max = 100),
    numericInput("obs", "", 10, min = 1, max = 100),
    numericInput("obs", NULL, 10, min = 1, max = 100)
)
Server <- function(input, output) {}
shinyApp(ui = UI, server = Server)

enter image description here