SlideShare a Scribd company logo
# Reading in the required datafiles from the source
time.parameter <- read.csv("timeparameter.csv")
safety.parameter <- read.csv("safetyparameter.csv")
cost.parameter <- read.csv("costparameter.csv")
cost.parameter.dropped <- cost.parameter[,c(-6,-7,-8)]
final.results <- read.csv("Finalresults.csv")
final.safety.results <- read.csv("Finalsafetyresults.csv")
final.cost.results <- read.csv("Finalcostresults.csv")
final.time.results <- read.csv("Finaltimeresults.csv")
final.weighted.data <- read.csv("Finalweighteddata.csv")
all.location <- read.csv("Location.csv")
locations <- all.location[1:30,]
locations$Location <- gsub(",",":",locations$Location)
placeNames <- as.character(locations$Intersection)
plotData <- data.frame(name = placeNames, latLong = unlist(locations$Location))
volume.by.year <- read.csv("~/Desktop/firstpanel/volumeByYear.csv")
volume.by.year.1 <- volume.by.year[,1:9]
volumeByYear <- read.csv("~/Desktop/firstpanel/volumeByYear.csv")
volumeByYear2013 <- volumeByYear[1:30,]
social.good.2016 <- read.csv("~/Desktop/firstpanel/socialgood.csv")
# ------ BEGIN UI -------------#
shinyUI(fluidPage(
tagList(
# --------- Calling theme Selector ------- #
shinythemes::themeSelector(),
# ------- Setting up Navigation Bar Title ------ #
navbarPage(
"DMS for DDI",
# -------- BEGIN RAW DATA PANEL -------- #
# Assigning Tab Name -> Will be used to see the raw data used for decision making
tabPanel("Raw Data",
sidebarPanel(
helpText("Select the parameters that you want to view TIME Data for"),
# Asking users to select which factors they want to view for TIME Parameter
selectInput("time.parameters", "Select the Time factors you want to view data for",
c("Intersections" = 1, "% of left turns" = 2, "Annual Hours wasted in Traffic" = 4, "Average Daily
Total Traffic" = 5, "Speed Limit" = 6, "Existing Lane Length" = 7), selected = 1, selectize = TRUE,
multiple = TRUE),
# Asking users to select which factors they want to view for COST Parameter
helpText("Select the parameters that you want to view COST Data for"),
selectInput("cost.parameters", "Select the Cost factors you want to view data for",
c("Intersections" = 1, "% of left turns" = 2, "Avg. Daily Total Traffic" = 3, "Shoulder Width" = 4),
selected = 1, selectize = TRUE, multiple = TRUE),
# Asking users to select which factors they want to view for SAFETY Parameter
helpText("Select the parameters that you want to view SAFETY Data for"),
selectInput("safety.parameters", "Select the Safety factors you want to view data for",
c("Intersections" = 1, "% of left turns" = 4, "Avg. Daily Total Traffic" = 5, "Shoulder Width" = 7,
"% of Trucks" = 8, "Clearance" = 9, "Speed Limit" = 10), selected = 1, selectize = TRUE, multiple =
TRUE),
#-----------------------------------------------------
selectInput("dataset", "Choose a dataset:",
choices = c("Time.Data", "Cost.Data", "Safety.Data", "Social.Good")),
downloadButton('downloadData', 'Download')
#-----------------------------------------------------
),
mainPanel(
# Dividing the main panel in RAW DATA Page into 3 tabs
tabsetPanel(
# Rendering table to showcase the required TIME data fields
tabPanel("Raw Time Data", tableOutput("time.data")),
# Rendering table to showcase the required COST data fields
tabPanel("Raw Cost Data", tableOutput("cost.data")),
# Rendering table to showcase the required SAFETY data fields
tabPanel("Raw Safety Data", tableOutput("safety.data"))
)
)
),
# ------- END OF PANEL 1 (DATA VIEWING) --------- #
# ------- Begin ANALYSIS PANEL (Running Analytics Engine) --------- #
tabPanel("Analysis Data",
titlePanel("Analytics"),
fluidRow(
column(4,
selectInput("intersections",
"Intersections:",
c("All",
unique(as.character(time.parameter$Intersections))))
),
column(4,
selectInput("exist.lane.length",
"Existing lane length:",
c("All",
unique(as.character(time.parameter$Existing.Lane.Length))))
),
column(4,
selectInput("left.turns",
"Left Turns:",
c("All",
unique(as.character(time.parameter$Lefts))))
)
),
# Create a new row for the table.
fluidRow(
DT::dataTableOutput("table")
)
),
# ------- END OF PANEL 2 (ANALYTICS) --------- #
# -------- BEGIN PANEL 3 (SUMMARY) --------- #
tabPanel("Summary",
sidebarPanel(
titlePanel("Data Summary"),
selectInput("time.summary", "Pls. Select the reqd choices to view the summary of TIME
data", c("Variable" = 1, "Count" = 2, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5,
"Max. Values" = 6), selected = 1, selectize = TRUE, multiple = TRUE),
selectInput("cost.summary", "Pls. Select the reqd choices to view the summary of COST
data", c("Variable" = 1, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5, "Max. Values"
= 6), selected = 1, selectize = TRUE, multiple = TRUE),
selectInput("safety.summary", "Pls. Select the reqd choices to view the summary of SAFETY
data", c("Variable" = 1, "Count" = 2, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5,
"Max. Values" = 6), selected = 1, selectize = TRUE, multiple = TRUE)
),
mainPanel(
tabsetPanel(
tabPanel("Time Data Summary", tableOutput("time.table")),
tabPanel("Cost Data Summary", tableOutput("cost.table")),
tabPanel("Safety Data Summary", tableOutput("safety.table"))
)
)
),
# ------- END OF PANEL 3 (Summary) --------- #
# --------------- PANEL 4 START ------------------- #
tabPanel("Wt'd Results Plot",
plotOutput("plot1",
click = "plot_click",
dblclick = "plot_dblclick",
hover = "plot_hover",
brush = "plot_brush"
),
verbatimTextOutput("info"),
plotOutput("plot2",
click = "plot_click",
dblclick = "plot_dblclick",
hover = "plot_hover",
brush = "plot_brush"
),
verbatimTextOutput("info1"),
plotOutput("plot3",
click = "plot_click",
dblclick = "plot_dblclick",
hover = "plot_hover",
brush = "plot_brush"
),
verbatimTextOutput("info2")
),
# --------------- PANEL 4 END ------------------- #
# --------------- PANEL 5 START ------------------- #
tabPanel("Table Results", verbatimTextOutput("result"), verbatimTextOutput("result.1")),
tabPanel("Graphs",
sidebarPanel(
helpText("Traffic and 911 Response are interactive plots that could be played around to
view data in different formats. For the interactive motion charts, there are 6 interactive layers
within the scatterplot. The x-axis variable, y-axis variable, linear and logarthmic scales, size of
the scatter plots, color of the scatter plots and motion across time. Apart from scatterplot you
can directly switch between line chart (have similar controls as above) and timeline chart (x-axis
is time and cannot be changed). As for Peak Traffic, it is a 3 D scatterplot giving users the feel
for the distance and placement for each intersection. Users can toggle on or off the
intersections they want and can freely rotate in a 3 D space to understand the points.")),
mainPanel(
tabsetPanel(
tabPanel("Traffic",
htmlOutput("gvis")),
tabPanel("911 Response",
htmlOutput("socialgood")),
tabPanel("Peak Traffic",
plotlyOutput("plot_ly"),
verbatimTextOutput("click_ly"),
verbatimTextOutput("hover_ly"))
))),
tabPanel("Maps", leafletOutput("map"), dataTableOutput("maps.table"))
# --------------- PANEL 5 END ------------------- #
)
)
)
)

More Related Content

What's hot

Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Dr. Volkan OBAN
 
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version) Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Tobias Pfeiffer
 
How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)
Tobias Pfeiffer
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
zefhemel
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J Script
Roman Agaev
 
The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196
Mahmoud Samir Fayed
 
Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009
mattsmiley
 
New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...
Sage Computing Services
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
Lei Kang
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
 
ggplot2 extensions-ggtree.
ggplot2 extensions-ggtree.ggplot2 extensions-ggtree.
ggplot2 extensions-ggtree.
Dr. Volkan OBAN
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Stripe
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
Anderson Dantas
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
 
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181
Mahmoud Samir Fayed
 
Group analyses with FieldTrip
Group analyses with FieldTripGroup analyses with FieldTrip
Group analyses with FieldTrip
Robert Oostenveld
 
Five
FiveFive
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
Brian Lonsdorf
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
Selena Deckelmann
 

What's hot (19)

Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
 
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version) Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 
How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J Script
 
The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196The Ring programming language version 1.7 book - Part 10 of 196
The Ring programming language version 1.7 book - Part 10 of 196
 
Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009
 
New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
ggplot2 extensions-ggtree.
ggplot2 extensions-ggtree.ggplot2 extensions-ggtree.
ggplot2 extensions-ggtree.
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181
 
Group analyses with FieldTrip
Group analyses with FieldTripGroup analyses with FieldTrip
Group analyses with FieldTrip
 
Five
FiveFive
Five
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 

Similar to R (Shiny Package) - UI Side Script for Decision Support System

Automated tool setting edge and center finding x and y axis
Automated tool setting edge and center finding x and y axisAutomated tool setting edge and center finding x and y axis
Automated tool setting edge and center finding x and y axis
Petrus Priyo Santosa
 
More than 12 More things about Oracle Database 12c
More than 12 More things about Oracle Database 12cMore than 12 More things about Oracle Database 12c
More than 12 More things about Oracle Database 12c
Guatemala User Group
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
Sander Kieft
 
Gps c
Gps cGps c
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdf
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdfUsing standard libraries like stdio and sdtlib.h and using stats.h a.pdf
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdf
fashiongallery1
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
OPITZ CONSULTING Deutschland
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
InfluxData
 
Youth Tobacco Survey Analysis
Youth Tobacco Survey AnalysisYouth Tobacco Survey Analysis
Youth Tobacco Survey Analysis
Roshik Ganesan
 
Hazelcast
HazelcastHazelcast
Hazelcast
oztalip
 
Tt subtemplates-caching
Tt subtemplates-cachingTt subtemplates-caching
Tt subtemplates-caching
Valeriy Studennikov
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
Assignment no39
Assignment no39Assignment no39
Assignment no39
Jay Patel
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
adhityalapcare
 
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdfC-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
herminaherman
 
please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
anfenterprises
 
Aimaf
AimafAimaf
Aimaf
Saad RGUIG
 
Assignment7.pdf
Assignment7.pdfAssignment7.pdf
Assignment7.pdf
dash41
 
C aptitude questions
C aptitude questionsC aptitude questions
C aptitude questions
Srikanth
 
C - aptitude3
C - aptitude3C - aptitude3
C - aptitude3
Srikanth
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
University of Illinois,Chicago
 

Similar to R (Shiny Package) - UI Side Script for Decision Support System (20)

Automated tool setting edge and center finding x and y axis
Automated tool setting edge and center finding x and y axisAutomated tool setting edge and center finding x and y axis
Automated tool setting edge and center finding x and y axis
 
More than 12 More things about Oracle Database 12c
More than 12 More things about Oracle Database 12cMore than 12 More things about Oracle Database 12c
More than 12 More things about Oracle Database 12c
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Gps c
Gps cGps c
Gps c
 
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdf
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdfUsing standard libraries like stdio and sdtlib.h and using stats.h a.pdf
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdf
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
 
Youth Tobacco Survey Analysis
Youth Tobacco Survey AnalysisYouth Tobacco Survey Analysis
Youth Tobacco Survey Analysis
 
Hazelcast
HazelcastHazelcast
Hazelcast
 
Tt subtemplates-caching
Tt subtemplates-cachingTt subtemplates-caching
Tt subtemplates-caching
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Assignment no39
Assignment no39Assignment no39
Assignment no39
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
 
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdfC-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
 
please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
 
Aimaf
AimafAimaf
Aimaf
 
Assignment7.pdf
Assignment7.pdfAssignment7.pdf
Assignment7.pdf
 
C aptitude questions
C aptitude questionsC aptitude questions
C aptitude questions
 
C - aptitude3
C - aptitude3C - aptitude3
C - aptitude3
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 

R (Shiny Package) - UI Side Script for Decision Support System

  • 1. # Reading in the required datafiles from the source time.parameter <- read.csv("timeparameter.csv") safety.parameter <- read.csv("safetyparameter.csv") cost.parameter <- read.csv("costparameter.csv") cost.parameter.dropped <- cost.parameter[,c(-6,-7,-8)] final.results <- read.csv("Finalresults.csv") final.safety.results <- read.csv("Finalsafetyresults.csv") final.cost.results <- read.csv("Finalcostresults.csv") final.time.results <- read.csv("Finaltimeresults.csv") final.weighted.data <- read.csv("Finalweighteddata.csv") all.location <- read.csv("Location.csv") locations <- all.location[1:30,] locations$Location <- gsub(",",":",locations$Location) placeNames <- as.character(locations$Intersection) plotData <- data.frame(name = placeNames, latLong = unlist(locations$Location)) volume.by.year <- read.csv("~/Desktop/firstpanel/volumeByYear.csv") volume.by.year.1 <- volume.by.year[,1:9] volumeByYear <- read.csv("~/Desktop/firstpanel/volumeByYear.csv") volumeByYear2013 <- volumeByYear[1:30,] social.good.2016 <- read.csv("~/Desktop/firstpanel/socialgood.csv") # ------ BEGIN UI -------------# shinyUI(fluidPage( tagList( # --------- Calling theme Selector ------- # shinythemes::themeSelector(), # ------- Setting up Navigation Bar Title ------ # navbarPage( "DMS for DDI", # -------- BEGIN RAW DATA PANEL -------- # # Assigning Tab Name -> Will be used to see the raw data used for decision making tabPanel("Raw Data", sidebarPanel( helpText("Select the parameters that you want to view TIME Data for"), # Asking users to select which factors they want to view for TIME Parameter selectInput("time.parameters", "Select the Time factors you want to view data for", c("Intersections" = 1, "% of left turns" = 2, "Annual Hours wasted in Traffic" = 4, "Average Daily Total Traffic" = 5, "Speed Limit" = 6, "Existing Lane Length" = 7), selected = 1, selectize = TRUE, multiple = TRUE), # Asking users to select which factors they want to view for COST Parameter helpText("Select the parameters that you want to view COST Data for"),
  • 2. selectInput("cost.parameters", "Select the Cost factors you want to view data for", c("Intersections" = 1, "% of left turns" = 2, "Avg. Daily Total Traffic" = 3, "Shoulder Width" = 4), selected = 1, selectize = TRUE, multiple = TRUE), # Asking users to select which factors they want to view for SAFETY Parameter helpText("Select the parameters that you want to view SAFETY Data for"), selectInput("safety.parameters", "Select the Safety factors you want to view data for", c("Intersections" = 1, "% of left turns" = 4, "Avg. Daily Total Traffic" = 5, "Shoulder Width" = 7, "% of Trucks" = 8, "Clearance" = 9, "Speed Limit" = 10), selected = 1, selectize = TRUE, multiple = TRUE), #----------------------------------------------------- selectInput("dataset", "Choose a dataset:", choices = c("Time.Data", "Cost.Data", "Safety.Data", "Social.Good")), downloadButton('downloadData', 'Download') #----------------------------------------------------- ), mainPanel( # Dividing the main panel in RAW DATA Page into 3 tabs tabsetPanel( # Rendering table to showcase the required TIME data fields tabPanel("Raw Time Data", tableOutput("time.data")), # Rendering table to showcase the required COST data fields tabPanel("Raw Cost Data", tableOutput("cost.data")), # Rendering table to showcase the required SAFETY data fields tabPanel("Raw Safety Data", tableOutput("safety.data")) ) ) ), # ------- END OF PANEL 1 (DATA VIEWING) --------- # # ------- Begin ANALYSIS PANEL (Running Analytics Engine) --------- # tabPanel("Analysis Data", titlePanel("Analytics"), fluidRow( column(4, selectInput("intersections", "Intersections:", c("All", unique(as.character(time.parameter$Intersections))))
  • 3. ), column(4, selectInput("exist.lane.length", "Existing lane length:", c("All", unique(as.character(time.parameter$Existing.Lane.Length)))) ), column(4, selectInput("left.turns", "Left Turns:", c("All", unique(as.character(time.parameter$Lefts)))) ) ), # Create a new row for the table. fluidRow( DT::dataTableOutput("table") ) ), # ------- END OF PANEL 2 (ANALYTICS) --------- # # -------- BEGIN PANEL 3 (SUMMARY) --------- # tabPanel("Summary", sidebarPanel( titlePanel("Data Summary"), selectInput("time.summary", "Pls. Select the reqd choices to view the summary of TIME data", c("Variable" = 1, "Count" = 2, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5, "Max. Values" = 6), selected = 1, selectize = TRUE, multiple = TRUE), selectInput("cost.summary", "Pls. Select the reqd choices to view the summary of COST data", c("Variable" = 1, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5, "Max. Values" = 6), selected = 1, selectize = TRUE, multiple = TRUE), selectInput("safety.summary", "Pls. Select the reqd choices to view the summary of SAFETY data", c("Variable" = 1, "Count" = 2, "Mean" = 3, "Standard Deviation" = 4, "Min. Values" = 5, "Max. Values" = 6), selected = 1, selectize = TRUE, multiple = TRUE) ), mainPanel(
  • 4. tabsetPanel( tabPanel("Time Data Summary", tableOutput("time.table")), tabPanel("Cost Data Summary", tableOutput("cost.table")), tabPanel("Safety Data Summary", tableOutput("safety.table")) ) ) ), # ------- END OF PANEL 3 (Summary) --------- # # --------------- PANEL 4 START ------------------- # tabPanel("Wt'd Results Plot", plotOutput("plot1", click = "plot_click", dblclick = "plot_dblclick", hover = "plot_hover", brush = "plot_brush" ), verbatimTextOutput("info"), plotOutput("plot2", click = "plot_click", dblclick = "plot_dblclick", hover = "plot_hover", brush = "plot_brush" ), verbatimTextOutput("info1"), plotOutput("plot3", click = "plot_click", dblclick = "plot_dblclick", hover = "plot_hover", brush = "plot_brush" ), verbatimTextOutput("info2") ), # --------------- PANEL 4 END ------------------- # # --------------- PANEL 5 START ------------------- # tabPanel("Table Results", verbatimTextOutput("result"), verbatimTextOutput("result.1")), tabPanel("Graphs", sidebarPanel( helpText("Traffic and 911 Response are interactive plots that could be played around to view data in different formats. For the interactive motion charts, there are 6 interactive layers
  • 5. within the scatterplot. The x-axis variable, y-axis variable, linear and logarthmic scales, size of the scatter plots, color of the scatter plots and motion across time. Apart from scatterplot you can directly switch between line chart (have similar controls as above) and timeline chart (x-axis is time and cannot be changed). As for Peak Traffic, it is a 3 D scatterplot giving users the feel for the distance and placement for each intersection. Users can toggle on or off the intersections they want and can freely rotate in a 3 D space to understand the points.")), mainPanel( tabsetPanel( tabPanel("Traffic", htmlOutput("gvis")), tabPanel("911 Response", htmlOutput("socialgood")), tabPanel("Peak Traffic", plotlyOutput("plot_ly"), verbatimTextOutput("click_ly"), verbatimTextOutput("hover_ly")) ))), tabPanel("Maps", leafletOutput("map"), dataTableOutput("maps.table")) # --------------- PANEL 5 END ------------------- # ) ) ) )