library(gsheet)
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
library(janitor)
##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
library(bangladesh)
library(tmap)
library(readr)
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
union <- get_map("union")
df <- gsheet2tbl("https://docs.google.com/spreadsheets/d/1dNNlD15vn_8qjRoiYfO2HH-3uzB0Y14zhlwoIYonsdc/edit?usp=sharing") %>%
clean_names()
district_map <- get_map("district")
map_data <- district_map %>%
left_join(df, by = c("District" = "district"))
tmap_mode("plot")
## ℹ tmap modes "plot" - "view"
## ℹ toggle with `tmap::ttm()`
tm_shape(map_data) +
tm_polygons(
fill = "population",
fill.scale = tm_scale_intervals(
style = "quantile",
n = 6,
value.na = "grey90"
))
