Polygons - A very simple Map with Polygons.

Library

library(sf)
library(ggplot2)
library(tigris)

SHP File

The SHP Data for Indonesia available from Humdata

Admin2KOKAB<-"D:/GDrive/01-Event/06-KSN-Peta/BaseMap/Lengkap/idn_admbnda_adm2_bps_20200401.shp"
Admin2<-st_read(Admin2KOKAB)
## Reading layer `idn_admbnda_adm2_bps_20200401' from data source `D:\GDrive\01-Event\06-KSN-Peta\BaseMap\Lengkap\idn_admbnda_adm2_bps_20200401.shp' using driver `ESRI Shapefile'
## Simple feature collection with 522 features and 14 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: 95.01079 ymin: -11.00762 xmax: 141.0194 ymax: 6.07693
## geographic CRS: WGS 84

Women in Parliaments for Cities of West Java Province of Indonesia in 2018

Data Source : Release of Ministry of Female Empowerment and Child Protection of the Republic of Indonesia in pdf format

wip<-read.csv("https://raw.githubusercontent.com/Nr5D/30DayMapChallenge/main/03-Women-in-Parliaments-of-West-Java.csv", sep=";")

Merge between Spatial Data (SHP) and Tabular Data (CSV)

merged.wip <- geo_join(spatial_data=Admin2, 
                             data_frame=wip, by_sp="ADM2_PCODE", 
                             by_df="ADM2_PCODE", how = "inner")

Color Scheme

my.col <- c("white", "pink", "red") 

A Polygon Map

pDATA<-ggplot()+
  geom_sf(data=merged.wip,aes(fill=WIP))+
  scale_fill_gradientn(colours=my.col)+
  #geom_text(data = wip, aes(x=longitude, y=latitude, label = ADM2_EN), size = 5) +
  labs(title = ~ atop(paste('Women in Parliaments ',italic("for Cities of West Java Province of Indonesia")),
                      paste(scriptstyle("2018"))),
      fill="Percentage")+
      theme(plot.title=element_text(hjust=0.5))

I try to use geom_text to make a label (names of cities), but there is an issue with coordinate that I used. I need to correct it manually..

The Map