在 FluidRow 之间减少 space

Reduce space between FluidRow

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

下面的代码展示了我尝试过的一些东西:

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) {
    
  }
)

一些帮助将不胜感激

也许您正在寻找这个。有关 fillRow() fillCol() 的更多详细信息,请参阅 here

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)