Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何将操作按钮的位置更改为底部?_R_Rstudio_Shiny - Fatal编程技术网

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

R 如何将操作按钮的位置更改为底部?,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

这是我的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")
>                    
>        )    )
这是我的服务器

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(),但没有导致任何更改。