/
Rworldmap_PopCov
21 lines (12 loc) · 929 Bytes
/
Rworldmap_PopCov
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(readxl)
library(rworldmap)
data2 = read_excel("D:/R/Files/Population Coverage_Country.xlsx")
y= data2 %>%
select(Country,Combined)
country_list = joinCountryData2Map(y,joinCode = "NAME", nameJoinColumn = "Country")
mapCountryData(country_list, mapTitle = "Population Coverage" , nameColumnToPlot='Country' ,
colourPalette = "terrain" , catMethod = 'fixedWidth' , addLegend = FALSE)
parameters = mapCountryData( country_list, mapTitle = "Population Coverage" , nameColumnToPlot="Combined", catMethod=c(0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0)
, addLegend=FALSE, colourPalette = "terrain", missingCountryCol = "dark grey" , oceanCol = "lightsteelblue2")
do.call( addMapLegend, c( parameters, legendLabels="all", legendWidth=0.5
, legendIntervals="page", legendMar = 2 ))