Skip to content

Instantly share code, notes, and snippets.

@jduckles
Last active March 21, 2018 05:38
Show Gist options
  • Save jduckles/c82c7e6751cec196872f to your computer and use it in GitHub Desktop.
Save jduckles/c82c7e6751cec196872f to your computer and use it in GitHub Desktop.
AT
BE
DK
FR
DE
IT
MD
NL
RU
CH
GB
CA
CR
GT
MX
US
EC
JP
AU
NZ
ZA
AE
IE
FI
NO
SE
library('rworldmap')
library('RColorBrewer')
setwd('~/git/tmp//tufte-jekyll/data')
cv <- read.csv('countries_visited.txt')
names(cv) <- c('iso2')
cv$visited <- TRUE
plotdata <- joinCountryData2Map(cv,joinCode = "ISO2", nameJoinColumn = "iso2")
pal <- rev(brewer.pal(n=1,name="Blues"))
svg('countries_visited.svg', width=10, height=8)
mapCountryData(plotdata, nameColumnToPlot = 'visited', addLegend = FALSE, colourPalette = pal, mapTitle = '',
borderCol = 'darkgray', oceanCol = 'grey99')
dev.off()
@jduckles
Copy link
Author

countries_visited.txt should be the 2-letter ISO codes of the countries you've been to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment