Skip to content
/ whomap Public

world choropleth maps, boundaries incl. disputed territories

License

Notifications You must be signed in to change notification settings

glaziou/whomap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R package whomap

version 0.9.1

Draws choropleth maps of the world, based on WHO shapefiles (simpler or more detailed issued in 2022), adapted from scripts from Tom Hiatt and Hazim Timimi.

Install:

remotes::install_github('glaziou/whomap')

Usage

whomap(X, colours = NULL, low.col = "#BDD7E7", high.col = "#08519C", line.col = "black", map.title = "", legend.title = "", background = NA, na.label = "No data", disclaimer = FALSE, legend.pos = c(0.14, 0.26), recentre = 12)

X is a dataframe. It must contain a variable named "iso3" holding country ISO3 codes, and a second categorical variable named "var". There should be no more than 6 categories (excluding "No data" and "Not applicable") for optimal display of the legend. The category labels should be short.

Examples:

Univariate

brics <- data.frame(iso3=c('BRA','CHN','IND','RUS','ZAF'), var=1)

whomap(brics, colour='red', legend.pos='none', water.col = 'white')

image

Oceans and lakes in light blue

whomap(brics, colour='red', legend.pos='none', water.col = 'lightblue')

image

brics$var <- 1:5

whomap(brics, legend.title='BRICS', water.col = 'white')

image

Recentered on the region Asia-Pacific, with the legend repositioned:

whomap(brics, legend.title = 'BRICS', legend.pos = c(0.7, 0.26), recentre = 163, water.col = 'white')

image

The above maps can be drawn using high-definition 2022 WHO shapefiles by passing a parameter "hidef = T" (default is F). The drawing in high-definition is considerably slower. The previous map in high-definition with the default colour for water bodies is shown below:

whomap(brics, legend.title = 'BRICS', legend.pos = c(0.7, 0.26), recentre = 163, hidef = TRUE)

image

Bivariate

World map also showing a secondary country marker denoting a second variable

whomap(brics, legend.title='BRICS', legend.pos=c(0.14, 0.34)) + add_marker('BRA', lab='Subnational\ndata')

image

About

world choropleth maps, boundaries incl. disputed territories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages