library(bangladesh)
## Warning: package 'bangladesh' was built under R version 4.5.2
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.5.2
##
## 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
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
# 1. Full Country map
plot(country[1], main = "1. Full Bangladesh Country Map")

# 3. Full Division map
plot(division[1], main = "3. All Divisions of Bangladesh Map")

# 5. Full District map
plot(district[1], main = "5. All Districts of Bangladesh Map")

# 2. division map (Dhaka Division)
# Filter for Dhaka Division
dhaka_division <- division %>%
filter(Division == "Dhaka")
# Plot the map
plot(dhaka_division[1], main = "Dhaka Division Map")

# 3.district map (Dhaka District)
# Filter for Dhaka District
dhaka_district <- district %>%
filter(District == "Dhaka")
# Plot the map
plot(dhaka_district[1], main = "Dhaka District Map")

#4. Any three upazila maps (Ramna, Jatrabari, Dhamrai)
# Filter for the three selected Upazilas
subset_upazila_dhaka <- upazila %>%
filter(Upazila %in% c("Ramna", "Jatrabari", "Dhamrai"))
# Plot the map
plot(subset_upazila_dhaka[1], main = "Selected Upazila Maps (Ramna, Jatrabari, Dhamrai)")
