logo

an effective solution for improving cause and cost of vehicle failure awareness among drivers.

Click Here For Visiting Dashboard


INTRODUCTION

1.OBJECTIVE

  • Vehicle crash contributes to a significant number of deaths and injuries in human races around the world.
  • The government and the transportation expert work together around the clock to lessen the number of injuries and fatalities cause from vehicle crash issues.
  • To come out with an effective solution whether from improving the trafficking system including road conditions or increasing awareness among drivers, the experts must analyze the data of vehicle crash from the past decades to find the major causes and come out with a decision.

Our visualization data provides complete failure analysis and the cost of labor for repair, and equipment for the vehicles, all over the United States.

With the help of this data our users can estimate the average cost of repair and average material cost, if a user is going to buy a used vehicle, then with the help of failure mileage, he can estimate the average mileage that a vehicle can travel without any issues according the location of his place and he can also know how much will it cost to get it repaired based on this data he can take the decision whether to buy vehicle or not



2.FUNCTIONAL REQUIREMENTS

  1. Attributes

    Analysis of car failures based on various independent variables like mileage, labor wages, etc. Analysis of car failure rate and the cost required to repair our vehicle based on various parameters like area(state), millage, labor costs, etc.

    1. Vehicle : vehicle id
    2. fm : Failure Month
    3. Mileage : The mileage at which car failure occurred
    4. lh : Labor hours (the amount of time took by the labor to repair the vehicle)
    5. lc : Labor cost (The cost of repairing the vehicle)
    6. mc : Material cost in dollars
    7. State : The state in which the failure occurred.
  2. Results

    Performing various comparisons among these parameters, we generate different types of visualizations like line graph, pie chart, box plot, etc, … and provide a report based on the conclusions obtained by comparing the data.

  3. End User Benifits

    Our results will be useful to the customers for estimating the cost of their vehicle repair and also to approximate the failure mileage and the data of previously failed vehicles, also the repairers can also estimate the materials cost required for repair.

DATA AND DESIGN REPRESENTATION


1.DATA REPRESENTATIONS

Data Representation refers to the form in which data is stored, processed, and transmitted.

Proposed Visualizations
R\C Pie Chart Bar Plot Scatter Plot
States  VS Failures Top Failures In all States State Wise Failures none
Mileage VS Failure Millage None Failure Mileage None
Mileage VS Month None None Mileage of vehicle before failure
Labour Cost VS State None State Wise Labour Cost None

2.Design Of The Proposed System:

  • R markdown file is used for the dashboard creation
  • The dashboard is divided into three pages containing different visualizations and a map for failure analysis and a data table
  • We will also include the top states for car failures and the failure mileage for different cars in our dashboard design.
  • We also have included tabs which display the dataset as table and we also have a tab for source code.

Libraries used for dashboard creation

                            
                                
```{r setup, include=FALSE} library(flexdashboard) library(knitr) library(DT) library(rpivotTable) library(ggplot2) library(plotly) library(dplyr) library(openintro) library(highcharter) library(ggvis)
  1. Goal

    The goal of flexdashboard is to make it easy to create interactive dashboards for R, using R Markdown.
  2. Knitr

    knitr is an engine for dynamic report generation with R. It is a package in the programming language R that enables integration of R code into LaTeX, LyX, HTML, Markdown
  3. DT

    Data objects in R can be rendered as HTML tables using the JavaScript library 'DataTables' (typically via R Markdown or Shiny). The 'DataTables' library has been included in this R package.
  4. rpivotTable

    The rpivotTable package is an R htmlwidget built around the pivottable library
  5. openintro

    openintro The package contains data sets used in our open-source textbooks along with custom plotting functions for reproducing book figures.

Dashboard Creation


VALUE BOXES

ValueBoxes are used to show the data in larger text like titles so we have placed in the main body of dashboard, we have shown “car failures in US and various states” , “Labor Cost” , Etc by using valueBox.

INITIALIZING THE FIRST PAGE

  1. A new Row which consists the interactive bar plot of Failures By State created using plot_ly
  2. A pie chart to indicate Top states Here we are only including the states which have failures more than 50
  3. An interactive bar plot of Failure month vs Failure mileage
  4. An interactive Scatter plot of Month Vs Mileage
  5. A Box Plot of Top State for labor costs using ggvis
  6. ggvis graphs are HTML, they can be used in a shiny web application, R markdown reports, it is easy to build interactive graphics for exploratory data analysis using ggvis

INITIALIZING SECOND AND THIRD PAGES

  1. Map visualization
  2. Extracting the data of number of car failures according to their state
  3. Interactive data table
  4. This Table provides multiple ways to narrow down the specific data
                        
                            

1.CREATING VALUE BOXES

Interactive Data Visualization ===================================== Row ------------------------------------- ### Car Failure Analysis ```{r} valueBox(paste("Failure"), color = "warning") ``` ### Car Failures in US ```{r} valueBox(length(data$State), icon = "fa-user") ``` ### **Labor Cost** ```{r} gauge(round(mean(data$lc), digits = 2), min = 0, max = 350, gaugeSectors(success = c(0, 150), warning = c(150, 240), danger = c(240, 350), colors = c("green","yellow","red"))) ``` ### Massachusetts ```{r} valueBox(sum(data$State == "MA"), icon = 'fa-building') ``` ### California ```{r} valueBox(sum(data$State == "CA"), icon = 'fa-building') ``` ### Texas ```{r} valueBox(sum(data$State == "TX"), icon = 'fa-building') ``` ### Florida ```{r} valueBox(sum(data$State == "FL"), icon = 'fa-building') ```
                        
                             

2.BAR PLOT FOR FAILURES OF EACH STATE

Row ------------------------------- ### Failures By State ```{r} p1 <- data %>% group_by(State) %>% summarise(count = n()) %>% plot_ly(x = ~State, y = ~count, color = "blue", type = 'bar') %>% layout(xaxis = list(title = "Failures By State"), yaxis = list(title = 'Count')) p1 ```
                        
                            

3.PIE CHART FOR FAILURE VS MILEAGE

### Top States ```{r} p2 <- data %>% group_by(State) %>% summarise(count = n()) %>% filter(count>50) %>% plot_ly(labels = ~State, values = ~count, marker = list(colors = mycolors)) %>% add_pie(hole = 0.2) %>% layout(xaxis = list(zeroline = F, showline = F, showticklabels = F, showgrid = F), yaxis = list(zeroline = F, showline = F, showticklabels=F, showgrid=F)) p2 ```
                    
                    

4.BAR PLOT FOR MILEAGE VS FAILURE MILEAGE

### FM Vs Mileage ```{r} p3 <- plot_ly(data, x=~fm, y=~Mileage, text=paste("FM:", data$fm, "Mileage:" , data$Mileage), type="bar" ) %>% layout(xaxis = list(title="FM"), yaxis = list(title = "Failure Mileage")) p3 ```
                        
                            

5.SCATTER PLOT FOR MONTHS VS MILEAGE

Row ------------------------------------ ### Scatter Plot of Month Vs Mileage ```{r} p4 <- plot_ly(data, x=~fm) %>% add_markers(y = ~Mileage, text = ~paste("Mileage: ", Mileage), showlegend = F) %>% add_lines(y = ~fitted(loess(Mileage ~ fm)), name = "Loess Smoother", color = I("#FFC125"), showlegend = T, line = list(width=5)) %>% layout(xaxis = list(title = "Month"), yaxis = list(title = "Mileage")) p4 ```
                        
                            

6.LABOUR COSTS IN EACH STATE

Labor costs ===================================== ```{r} data %>% group_by(State) %>% ggvis(~State, ~lc, fill = ~State) %>% layer_boxplots() ```
                        
                            

7.COLOR MAP WHICH SHOWS STATE-WISE FALIURES

Map ======================================== ### Map ```{r} car <- data %>% group_by(State) %>% summarize(total = n()) car$State <- abbr2state(car$State) highchart() %>% hc_title(text = "Car Failures in US") %>% hc_subtitle(text = "Source: Vehiclefailure.csv") %>% hc_add_series_map(usgeojson, car, name = "State", value = "total", joinBy = c("woename", "State")) %>% hc_mapNavigation(enabled = T) ```
                        
                            

8.DATA TABLE

Data Table ======================================== ```{r} datatable(data, caption = "Failure Data", rownames = T, filter = "top", options = list(pageLength = 25)) ```


RESULT ANALYSIS

                        
                            
Summary Report {data-oriuentation = columns} =========================================== Column {data-width = 100} ----------------------------------- ### Max Failures In Month ```{r} valueBox(max(data$fm), icon = "fa-user" ) ``` ### Average Labor cost ```{r} valueBox(round(mean(data$lc), digits = 2), icon = "fa-area-chart") ``` ### Average Mileage at Failure ```{r} valueBox(round(mean(data$Mileage), digits = 2), icon = "fa-area-chart")
                        
                            
1.This is a report on `r length(data$fm)` car failures. // length captures the amount of failures 2.The average labor cost was `r mean(data$lc)`. // average labor cost 3.The average material cost was `r mean(data$mc)`. // average material cost

That's it!!!🥳 I hope this blog gives you a basic understanding about Data visualization and how to craete a dashboard for our web applications using R-Markdown

Give Your Comment





Comments

Name

Comment

Name

Comment

Name

Comment

Back To Top