waffle_report

Author

srushtivh spandana

Introduction

This report presents a waffle chart visualization comparing the distribution of occupations between urban and rural areas.

Data Preparation

library(tibble)
library(waffle)
Loading required package: ggplot2
library(ggplot2)
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
# Define occupation data
Occupation_data <- tribble(
  ~Occupation, ~Urban, ~Rural,
  "Agriculture", 5, 30,
  "Manufacturing", 20, 25,
  "Services", 40, 20,
  "Education/Healthcare", 25, 15,
  "Other", 10, 10
)
print(Occupation_data)
# A tibble: 5 × 3
  Occupation           Urban Rural
  <chr>                <dbl> <dbl>
1 Agriculture              5    30
2 Manufacturing           20    25
3 Services                40    20
4 Education/Healthcare    25    15
5 Other                   10    10

Visualization - Waffle Chart

Create two waffle plots side by side

urban_vec <- setNames(Occupation_data$Urban, Occupation_data$Occupation)
rural_vec <- setNames(Occupation_data$Rural, Occupation_data$Occupation)

par(mfrow=c(1,2))
waffle(urban_vec, rows = 10, title = "Urban Occupation Distribution", colors = c("green", "blue", "orange", "purple", "grey"))

waffle(rural_vec, rows = 10, title = "Rural Occupation Distribution", colors = c("green", "blue", "orange", "purple", "grey"))

Interpretation

Urban areas have the highest share in Services and Education/Healthcare.

Rural areas are dominated by Agriculture.

The Other category is evenly distributed.

This chart clearly shows a shift from traditional to service-oriented jobs in urban locations.

Objective

Visualize and compare occupation distributions in urban and rural areas using waffle charts.

Occupation Data

par(mfrow=c(1,2))
waffle(urban_vec, rows = 10, title = "Urban", colors = c("green", "blue", "orange", "purple", "grey"))

waffle(rural_vec, rows = 10, title = "Rural", colors = c("green", "blue", "orange", "purple", "grey"))

Insights

Rural → Agriculture-dominant

Urban → Service and Healthcare lead

Policy planning can use this for resource allocation

Conclusion

Waffle charts make occupational patterns easy to interpret and compare across demographics.