11.5 UI: Layout

  • Apps consist of ui, server and shinyApp(ui=ui, server = server)
  • fluidPage(): Creates a display that automatically adjusts to the dimensions of a user’s browser window (smartphone!)
    • Lay out your app by placing elements in the fluidpage function
  • Below a user interface with a title panel and a sidebar panel
    • titlePanel and sidebarLayout create a basic Shiny app/layout with a sidebar
    • sidebarLayout takes two functions
      • sidebarPanel: Includes content displayed in the sidebar
      • mainPanel: Includes content displayed in the main panel
  • Try the code below by pasting it into your console and running the app again
  • Change sidebarLayout(... to sidebarLayout(position = "right",...