library(bangladesh)
district <- get_map("district")
plot(district[1])

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
subset_district <- district %>%
  filter(District %in% c("Dinajpur"))

plot(subset_district[1])

library(tmap)
library(bangladesh)
district <- get_map("district")

tm_shape(district) +
  tm_polygons(fill = "District") +
  tm_title("Administrative District of Bangladesh") +
  tm_text("District") +
  tm_compass(position = c("left", "bottom"), type = "8star", size = 5) +
  tm_scalebar(position = c("right", "bottom"), text.size = 0.7)+
  tm_grid(lines = TRUE, labels.size = 0.8, col = "gray90")
## Warning: Number of levels of the variable assigned to the aesthetic "fill" of
## the layer "polygons" is 64, which is larger than n.max (which is 30), so levels
## are combined.
## [plot mode] fit legend/component: Some legend items or map compoments do not
## fit well, and are therefore rescaled.
## ℹ Set the tmap option `component.autoscale = FALSE` to disable rescaling.

upazila <- get_map("upazila")

plot(upazila[1])

library(dplyr)
subset_upazila <- upazila %>%
  filter(Upazila %in% c("Ramna"))

plot(subset_upazila[1])

tm_shape(upazila) +
  tm_polygons(fill = "Upazila") +
  tm_title("Administrative Upazila of Bangladesh") +
  tm_text("Upazila") +
  tm_compass(position = c("left", "bottom"), type = "8star", size = 5) +
  tm_scalebar(position = c("right", "bottom"), text.size = 0.7)+
  tm_grid(lines = TRUE, labels.size = 0.8, col = "gray90")
## Warning: Number of levels of the variable assigned to the aesthetic "fill" of
## the layer "polygons" is 527, which is larger than n.max (which is 30), so
## levels are combined.
## [plot mode] fit legend/component: Some legend items or map compoments do not
## fit well, and are therefore rescaled.
## ℹ Set the tmap option `component.autoscale = FALSE` to disable rescaling.