Name: Swetha P
Roll Number: 23BAD119
This experiment focuses on applying visual encoding techniques to represent complex traffic accident data using a single visualization. Multiple data attributes are encoded using visual properties such as color, size, and shape to effectively communicate accident severity, casualty impact, and accident type across different locations.
The dataset (4.traffic_accidents.csv) contains traffic accident records with the following attributes:
- Location
- Number of vehicles involved
- Accident severity
- Number of casualties
- Accident type
The dataset is used to analyze and visually represent traffic accident risk factors.
- R Programming Language
- RStudio
Libraries Used:
ggplot2– visual encoding and multivariate data visualization
- Loaded the required R library (
ggplot2). - Imported the traffic accident dataset using
read.csv(). - Mapped accident locations to the x-axis and number of vehicles involved to the y-axis.
- Encoded accident severity using color variations.
- Represented the number of casualties using point size encoding.
- Differentiated accident types using distinct point shapes.
- Generated a multivariate scatter plot to visualize traffic accident risk patterns.
- Color Encoding: Represents accident severity (Minor, Major, Fatal)
- Size Encoding: Indicates the number of casualties
- Shape Encoding: Differentiates accident types
- Scatter Plot: Displays multivariate relationships
(The implemented chart is included separately.)
This experiment demonstrates how visual encoding techniques can effectively represent multiple dimensions of data within a single chart. By mapping traffic accident attributes to visual properties such as color, size, and shape, the visualization provides clear insights into accident severity and risk patterns, supporting improved traffic safety analysis and decision-making.