Створення панелей керування з shinydashboard
Png Kee Seng
Researcher
Ми працюємо в туристичній агенції в Лондоні.
Туристам потрібне житло.
Чим ми можемо допомогти?


header <- dashboardHeader(
title = "Home rental listings")
sidebar <- dashboardSidebar()
body <- dashboardBody()
ui <- dashboardPage(header,
sidebar,
body)
server <- function(input, output) {}
shinyApp(ui, server)
У body:
fluidRow(
valueBoxOutput(outputId = "count"),
valueBoxOutput(outputId = "prop"),
valueBoxOutput(outputId = "avg"))
У server:
output$count <- renderValueBox({
valueBox(..., icon = ...)})
output$prop <- renderValueBox(...)
...
У body:
box(
side = "right", ...,
sliderInput(inputId = "range",
label = "Select price range:",
min = 0,
max = 25000,
value = c(0,25000))
))
Оновіть server, використовуючи input$range[1] і input$range[2]

У body:
plotlyOutput("plots",
height = 500,
width = 600)
У server:
output$plots <- renderPlotly({
...
})

У body:
selectInput(inputId = "select",
label = "Select group:",
choices = c("Neighbourhood",
"Room Type"))
У server:
output$plots <- renderPlotly({
if (input$select == ...){plot1}
else if(input$select == ...){plot2}
})
У body:
box(side = "right", ...,
title = "Welcome to London!",
"...")
Оновіть у body:
tabBox(id = "tabset", ...,
tabPanel("Charts", ...),
tabPanel("Data table", ...)

Можемо використати функції shiny.
У body:
dataTableOutput("table")
У server:
output$table <-
renderDataTable(listings)

У sidebar:
sidebarMenu(
menuItem("Charts", ...),
menuItem("Map", ...))
У body:
leafletOutput("map",...)
У server:
output$map <- renderLeaflet(map)
Створення панелей керування з shinydashboard