2020-06-28 15:52:07 +02:00
|
|
|
library(shiny)
|
|
|
|
library(markdown)
|
|
|
|
library(tidyverse)
|
|
|
|
library(dplyr)
|
|
|
|
library(shinycssloaders)
|
|
|
|
library(shinythemes)
|
|
|
|
|
|
|
|
shinyUI(navbarPage(
|
|
|
|
theme = shinytheme("flatly"),
|
|
|
|
"Wypadki w UE",
|
|
|
|
tabPanel(
|
|
|
|
"Dane ogólne",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary śmiertelne wypadków drogowych w UE"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"year",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
checkboxInput("factor", "w przeliczeniu na 100 tys. mieszkańców", TRUE)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(tabsetPanel(
|
|
|
|
tabPanel("Wykres", plotOutput("roadAccidentsPlot") %>% withSpinner(color="#0dc5c1")),
|
|
|
|
tabPanel("Mapa", plotOutput("mapPlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"Dane wg pojazdu",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary śmiertelne wypadków drogowych w UE wg pojazdu"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"vehYear",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
selectInput(
|
|
|
|
"vehicle",
|
|
|
|
"Rodzaj pojazdu:",
|
|
|
|
list(
|
|
|
|
"Samochód osobowy" = "CAR",
|
|
|
|
"Rower" = "BIKE",
|
|
|
|
"Bus" = "BUS",
|
|
|
|
"Ciężarówka > 3.5 tony" = "VG_GT3P5",
|
|
|
|
"Pojazd ostawczy <= 3.5 tony" = "VG_LE3P5"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(tabsetPanel(
|
|
|
|
tabPanel("Wykres", plotOutput("roadAccidentsByVehiclePlot") %>% withSpinner(color="#0dc5c1")),
|
|
|
|
tabPanel("Mapa", plotOutput("mapByVehiclePlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"Dane wg użytkowników dróg",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary śmiertelne wypadków drogowych w UE wg użytkowników dróg"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"userYear",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
selectInput(
|
|
|
|
"user",
|
|
|
|
"Typ użytkownika:",
|
|
|
|
list(
|
|
|
|
"Piesi" = "PED",
|
|
|
|
"Kierujący" = "DRIV",
|
|
|
|
"Pasażerowie" = "PAS"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(tabsetPanel(
|
|
|
|
tabPanel("Wykres", plotOutput("roadAccidentsByUserPlot") %>% withSpinner(color="#0dc5c1")),
|
|
|
|
tabPanel("Mapa", plotOutput("mapByUserPlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"Dane wg rodzaju dróg",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary śmiertelne wypadków drogowych w UE wg rodzaju dróg"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"roadTypeYear",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
selectInput(
|
|
|
|
"roadType",
|
|
|
|
"Typ drogi:",
|
|
|
|
list(
|
|
|
|
"Autostrada" = "MWAY",
|
|
|
|
"Teren zabudowany" = "RD_URB",
|
|
|
|
"Droga wiejska" = "RD_RUR"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(tabsetPanel(
|
|
|
|
tabPanel("Wykres", plotOutput("roadAccidentsByRoadTypePlot") %>% withSpinner(color="#0dc5c1")),
|
|
|
|
tabPanel("Mapa", plotOutput("mapByRoadTypePlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"Trend",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary śmiertelne wypadków drogowych w UE w latach 2000-2018"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
checkboxGroupInput("countries", label = h3("Wybierz państwa:"),
|
2020-06-28 16:33:11 +02:00
|
|
|
choices = list("Polska" = "PL",
|
|
|
|
"Czechy" = "CZ",
|
|
|
|
"Belgia" = "BE",
|
|
|
|
"Dania" = "DK",
|
|
|
|
"Litwa" = "LT",
|
|
|
|
"Łotwa" = "LV",
|
|
|
|
"Holandia" = "NL",
|
|
|
|
"Rumunia" = "RO",
|
|
|
|
"Węgry" = "HU",
|
|
|
|
"Bułgaria" = "BG",
|
|
|
|
"Słowacja" = "SK",
|
2020-06-28 15:52:07 +02:00
|
|
|
"Niemcy" = "DE",
|
|
|
|
"Francja" = "FR",
|
|
|
|
"Wielka Brytania" = "UK",
|
|
|
|
"Hiszpania" = "ES",
|
|
|
|
"Szwecja" = "SE",
|
|
|
|
"Włochy" = "IT",
|
|
|
|
"Austria" = "AT",
|
|
|
|
"Portugalia" = "PT"),
|
|
|
|
selected = "PL"),
|
|
|
|
checkboxInput("timeChangefactor", "w przeliczeniu na 100 tys. mieszkańców", TRUE)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(plotOutput("timeChangePlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"NUTS-2",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary wypadków drogowych w UE wg podziału NUTS-2"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"nutsYear",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
selectInput(
|
|
|
|
"victimType",
|
|
|
|
"Rodzaj ofiary:",
|
|
|
|
list(
|
|
|
|
"Zabici" = "KIL",
|
|
|
|
"Ranni" = "INJ"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
checkboxInput("nutsfactor", "w przeliczenia na 1 mln. mieszkańców", TRUE)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(plotOutput("nutsPlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"Niemcy",
|
|
|
|
pageWithSidebar(
|
|
|
|
headerPanel("Ofiary wypadków drogowych w RFN"),
|
|
|
|
|
|
|
|
sidebarPanel(
|
|
|
|
selectInput(
|
|
|
|
"germanyYear",
|
|
|
|
"Rok:",
|
|
|
|
list(
|
|
|
|
"2000" = "2000",
|
|
|
|
"2001" = "2001",
|
|
|
|
"2002" = "2002",
|
|
|
|
"2003" = "2003",
|
|
|
|
"2004" = "2004",
|
|
|
|
"2005" = "2005",
|
|
|
|
"2006" = "2006",
|
|
|
|
"2007" = "2007",
|
|
|
|
"2008" = "2008",
|
|
|
|
"2009" = "2009",
|
|
|
|
"2010" = "2010",
|
|
|
|
"2011" = "2011",
|
|
|
|
"2012" = "2012",
|
|
|
|
"2013" = "2013",
|
|
|
|
"2014" = "2014",
|
|
|
|
"2015" = "2015",
|
|
|
|
"2016" = "2016",
|
|
|
|
"2017" = "2017",
|
|
|
|
"2018" = "2018"
|
2020-06-28 16:33:11 +02:00
|
|
|
), selected = "2018"
|
2020-06-28 15:52:07 +02:00
|
|
|
),
|
|
|
|
selectInput(
|
|
|
|
"germanyVictimType",
|
|
|
|
"Rodzaj ofiary:",
|
|
|
|
list(
|
|
|
|
"Zabici" = "KIL",
|
|
|
|
"Ranni" = "INJ"
|
|
|
|
)
|
|
|
|
),
|
|
|
|
checkboxInput("germanyFactor", "w przeliczenia na 1 mln. mieszkańców", TRUE),
|
|
|
|
checkboxInput("ddrBorder", "historyczne granice NRD", FALSE)
|
|
|
|
),
|
|
|
|
|
|
|
|
mainPanel(plotOutput("germanyPlot") %>% withSpinner(color="#0dc5c1"))
|
|
|
|
)
|
|
|
|
),
|
|
|
|
tabPanel(
|
|
|
|
"O programie",
|
|
|
|
fluidPage(
|
|
|
|
fluidRow(
|
|
|
|
column(2, strong("Autor:")),
|
|
|
|
column(4, strong("Maciej Karczewski"))
|
|
|
|
),
|
|
|
|
fluidRow(
|
|
|
|
column(2, strong("Projekt:")),
|
|
|
|
column(4, strong("Wypadki drogowe w UE"))
|
|
|
|
),
|
|
|
|
fluidRow(
|
|
|
|
column(2, strong("Przedmiot:")),
|
|
|
|
column(4, strong("Interaktywne wizualizacje w analizie biznesowej"))
|
|
|
|
),
|
|
|
|
fluidRow(
|
|
|
|
column(2, strong("Źródło danych:")),
|
|
|
|
column(4, strong("Eurostat"))
|
|
|
|
))
|
|
|
|
|
|
|
|
)
|
|
|
|
))
|