library(bangladesh)
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
union <- get_map("union")
plot(division[1], border= "red", col= "darkgreen", main = "Division Map of Bangladesh")
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
rangpur_districts <- district %>%
filter(Division == "Rangpur")
plot(rangpur_districts[1], col = colorRampPalette(c("lightblue", "skyblue", "steelblue"))(length(district)),
border = "white",
lwd = 0.15,
main = "My Division Map: Rangpur")
## Warning in plot.sf(rangpur_districts[1], col = colorRampPalette(c("lightblue",
## : col is not of length 1 or nrow(x): colors will be recycled; use pal to
## specify a color palette
# District Map
plot(district[1], col = terrain.colors(length(district)),
border = "grey50",
lwd = 0.1, main = "District Map of Bangladesh")
## Warning in plot.sf(district[1], col = terrain.colors(length(district)), : col
## is not of length 1 or nrow(x): colors will be recycled; use pal to specify a
## color palette
# My District (Thakurgaon)
thakurgaon_upazila <- upazila %>%
filter(District == "Thakurgaon")
plot(thakurgaon_upazila[1], col = rainbow(length(upazila), alpha = 0.6),
border = "grey30",lwd = 0.2, main = "My District Map: Thakurgaon ")
## Warning in plot.sf(thakurgaon_upazila[1], col = rainbow(length(upazila), : col
## is not of length 1 or nrow(x): colors will be recycled; use pal to specify a
## color palette
plot(upazila[1], col = colorRampPalette(c("darkgreen", "yellow", "red"))(length(upazila)),
border = "black",
lwd = 0.15,
main = "Upazila Map of Bangladesh")
## Warning in plot.sf(upazila[1], col = colorRampPalette(c("darkgreen", "yellow",
## : col is not of length 1 or nrow(x): colors will be recycled; use pal to
## specify a color palette
subset_upazila <- upazila %>%
filter(Upazila %in% c("Baliadangi", "Haripur", "Ranisankail"))
plot(subset_upazila[1], border= "black", col= c("darkgreen","red","yellow"), main = "Three Upazila Map of Thakurgaon District" )
`