R 如何将操作按钮的位置更改为底部?
这是我的ui.rR 如何将操作按钮的位置更改为底部?,r,rstudio,shiny,R,Rstudio,Shiny,这是我的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("t
> 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")
>
> ) )
这是我的服务器
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 })
})
shinyServer(功能(输入、输出){
#您可以通过输入$text访问小部件的值,例如。
输出$value我认为问题来自列()
您在调用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()
的一个很好的候选设置。如果在actionButton()
之前删除br()
,会发生什么?这是否解决了对齐问题?@ulfelder我尝试删除br(),但没有导致任何更改。