我应该如何将操作按钮的位置更改为底部?

how should I change the position of action button to the bottom?

这是我的 ui.r

> shinyUI(fluidPage(
>                     headerPanel(" UI demo "),
>                     #line below is to make a text input box
>     textInput("text", label = h3("Enter search item 1"), value = "apple"),
>     textInput("text", label = h3("Enter search item 2"), value = "google"),
>     dateRangeInput("dates", label = h3("Date range")),    
>     column(4,
>            
>            # Copy the line below to make a slider range 
>            sliderInput("slider2", label = h3("Slider Range"), min = 0, 
>                        max = 15000, value = 3000)
>     ),
>     br(),
>     actionButton("action", label = "Analyse")
>                    
>        )    )

这是我的server.R

shinyServer(function(input, output) {

  # You can access the value of the widget with input$text, e.g.

  output$value<-renderPrint({input$text})
  # You can access the value of the widget with input$slider1, e.g.
  output$value <- renderPrint({ input$dates })
  # You can access the values of the second widget with input$slider2, e.g.
  output$range <- renderPrint({ input$slider2 })  


  output$value <- renderPrint({ input$action })


})

这是我当前输出的屏幕截图

我想知道如何将分析(操作按钮)置于范围滑块下方。我应该如何将它们全部对齐。如您所见,滑块输入与分析按钮一起关闭。 我是 R 的新手,闪亮任何 help/resource 表示赞赏 谢谢

我认为问题出在 column() 您尝试在调用 sliderInput() 之前开始。下面的代码给了我一组等宽的输入选择器,底部有操作按钮:

shinyUI(fluidPage(

    headerPanel(" UI demo "),
    textInput("text", label = h3("Enter search item 1"), value = "apple"),
    textInput("text", label = h3("Enter search item 2"), value = "google"),
    dateRangeInput("dates", label = h3("Date range")),
    sliderInput("slider2", label = h3("Slider Range"), min = 0, max = 15000, value = 3000),
    br(),
    actionButton("action", label = "Analyse")                    

))

此设置也很适合 sidebarLayout()