减少FluidRow之间的空间

减少FluidRow之间的空间,r,layout,shiny,shinydashboard,R,Layout,Shiny,Shinydashboard,我正试图在shiny中创建一个特定的布局,我一直在减少tab1和tab5之间的空间: 下面的代码显示了我尝试过的几件事情: body <- dashboardBody( fluidRow( tabBox( height = "300px", tabPanel("tab1") ), tabBox( height = "600px", tabPanel(&q

我正试图在shiny中创建一个特定的布局,我一直在减少tab1和tab5之间的空间:

下面的代码显示了我尝试过的几件事情:

body <- dashboardBody(
  fluidRow(
    tabBox(
      height = "300px",
      tabPanel("tab1")
    ),
    tabBox(
      height = "600px",
      tabPanel("tab2"),
      tabPanel("tab3"),
      tabPanel("tab4")
    )
  ),
  fluidRow(
    tabBox(
      height = "300px",
      tabPanel("tab5")
    )
  )
)

shinyApp(
  ui = dashboardPage(
    dashboardHeader(title = "example"),
    dashboardSidebar(),
    body
  ),
  server = function(input, output) {
    
  }
)

body也许你在找这个。有关
fillRow()
fillCol()
的详细信息,请参阅

ui
ui <- fillPage(
  fillRow( #flex=c(1,1),
    fillCol(
      div(shinydashboard::tabBox(
        height = "300px", width="100%",
        tabPanel("tab1", plotOutput("plotTopLeft", height = "300px"))
      )),
      div(shinydashboard::tabBox(
        height = "300px", width="100%",
        tabPanel("tab5", plotOutput("plotBottomLeft", height = "300px"))
      ))
    ),
    fillCol(
      shinydashboard::tabBox(
        height = "600px", width="100%",
        tabPanel("tab2", plotOutput("plotRight", height = "550px")),
        tabPanel("tab3"),
        tabPanel("tab4")
      )
    )
  )

)

server <- function(input, output) {
  output$plotTopLeft <- renderPlot(plot(cars))
  output$plotRight <- renderPlot(plot(pressure))
  output$plotBottomLeft <- renderPlot(plot(AirPassengers))
}

shinyApp(ui = ui, server = server)