R 增加selectinput的高度

R 增加selectinput的高度,r,shiny,R,Shiny,有没有办法通过增加高度来扩展selectInput()的大小?基本上,我希望显示所有可用的选项,并使selectinput框变大 #ui.r fluidPage( # Copy the line below to make a select box selectInput("select", label = h3("Select box"), choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),

有没有办法通过增加高度来扩展
selectInput()
的大小?基本上,我希望显示所有可用的选项,并使selectinput框变大

#ui.r
fluidPage(

  # Copy the line below to make a select box 
  selectInput("select", label = h3("Select box"), 
    choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
    selected = 1),

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

)
#server.r
function(input, output) {

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

}
#ui.r
流动摄影(
#复制下面的行以创建一个选择框
选择输入(“选择”,标签=h3(“选择框”),
选项=列表(“选项1”=1,“选项2”=2,“选项3”=3),
选定值=1),
hr(),
fluidRow(第3列,逐字输出(“值”))
)
#服务器.r
功能(输入、输出){
#您可以使用输入$select访问小部件的值,例如。

输出$value您可以使用下面的选项,如果可行,请尝试:

library(shiny)

    ui <- fluidPage(
      fluidRow(

        selectInput("distance", label=NULL, choices = list("1" = 1, "2" = 2), selected = 1),
        tags$head(tags$style(HTML(".selectize-input {height: 150px; width: 550px; font-size: 50px;}")))
      )

)
server <- function(input, output){}
shinyApp(ui, server)

使用单选按钮:

ui<-fluidPage(

    # Copy the line below to make a select box 
    radioButtons("select", label = h3("Select box"), 
                choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
                selected = 1),

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

  )
  #server.r
 server<- function(input, output) {

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

  }

shinyApp(ui, server)

ui它增加了框,但仍然只显示第一个选项。
selectInput
在一个默认情况下会生成下拉列表的函数中。我已经用
checkboxGroupInput
添加了您的示例,以满足您的用例。@firmo23您也可以对您的用例@firmo23使用
radioButtons
,如exa所述上面的示例。接受并向上投票答案,如果它解决了问题,请尝试使用
checkboxGroupInput
ui<-fluidPage(

    # Copy the line below to make a select box 
    radioButtons("select", label = h3("Select box"), 
                choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
                selected = 1),

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

  )
  #server.r
 server<- function(input, output) {

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

  }

shinyApp(ui, server)