Dashboards bouwen met shinydashboard
Png Kee Seng
Researcher
We werken voor een reisbureau in Londen.
Toeristen hebben een verblijf nodig.
Hoe kunnen we helpen?


header <- dashboardHeader(
title = "Home rental listings")
sidebar <- dashboardSidebar()
body <- dashboardBody()
ui <- dashboardPage(header,
sidebar,
body)
server <- function(input, output) {}
shinyApp(ui, server)
In body:
fluidRow(
valueBoxOutput(outputId = "count"),
valueBoxOutput(outputId = "prop"),
valueBoxOutput(outputId = "avg"))
In server:
output$count <- renderValueBox({
valueBox(..., icon = ...)})
output$prop <- renderValueBox(...)
...
In body:
box(
side = "right", ...,
sliderInput(inputId = "range",
label = "Selecteer prijsklasse:",
min = 0,
max = 25000,
value = c(0,25000))
))
Update server met input$range[1] en input$range[2]

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

In body:
selectInput(inputId = "select",
label = "Selecteer groep:",
choices = c("Neighbourhood",
"Room Type"))
In server:
output$plots <- renderPlotly({
if (input$select == ...){plot1}
else if(input$select == ...){plot2}
})
In body:
box(side = "right", ...,
title = "Welkom in Londen!",
"...")
Update in body:
tabBox(id = "tabset", ...,
tabPanel("Grafieken", ...),
tabPanel("Datatabel", ...)

We kunnen shiny-functies gebruiken.
In body:
dataTableOutput("table")
In server:
output$table <-
renderDataTable(listings)

In sidebar:
sidebarMenu(
menuItem("Grafieken", ...),
menuItem("Kaart", ...))
In body:
leafletOutput("map",...)
In server:
output$map <- renderLeaflet(map)
Dashboards bouwen met shinydashboard