LA-1 presentation

Asmita DV(1NT23IS068)/Himanshu Singh(1NT23IS084)-Section B

Team 11:

-Asmita DV/Himanshu Singh

Question: Plot a dumbbell chart comparing male vs female literacy rates across states.

Step 1: Load necessary libraries

We begin by loading key libraries. ggplot2 is used to create visualizations, while ggalt provides the geom_dumbbell() function for comparing two values visually. readr allows us to efficiently read the CSV file, and dplyr is used for data cleaning and preparation.

Step 2: Load the CSV file

To load the CSV file into R, we use the read_csv() function from readr. This imports the data as a data frame, allowing us to manipulate and visualize the data. This step is essential for handling structured datasets.

Step 3: Extract relevant columns and rename for simplicity

Next, we extract only the necessary columns and rename them for clarity. We use dplyr to select the relevant columns and rename them. Simplified names help enhance the plot’s clarity, especially when labeling axes or legends.

Step 4: Plot dumbbell chart

Finally, we create the dumbbell chart using ggplot2. The geom_segment() function draws lines between the male and female literacy rates, while geom_point() places points at each end of the line. This visually compares the two values for each state.

This final step generates the chart comparing the male and female literacy rates across Indian states for 2001.