Skip to content

Commit

Permalink
code to generate figure 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyjoseph committed Jan 23, 2014
1 parent ffde019 commit 50b55fe
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions gen_map.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
library(rworldmap)

countries <-
c("DZA",
"BHR",
"EGY",
"TUN",
"IRN",
"YEM",
"IRQ",
"JOR",
"KWT",
"SYR",
"LBN",
"ESH",
"LBY",
"MAR",
"OMN",
"SAU",
"QAT",
"ARE")
country_names <- c(
"Algeria",
"Bahrain",
"Egypt",
"Tunisia",
"Iran",
"Yemen",
"Islamic Republic of Iraq",
"Jordan",
"Kuwait",
"Syria",
"Lebanon",
"Western Sahara",
"Libyan Arab Jamahiriya",
"Morocco",
"Oman",
"Saudi Arabia",
"Qatar",
"United Arab Emirates"
)
df <- data.frame(country=countries,blah=country_names)
df2 <- joinCountryData2Map(df, joinCode="ISO3",nameJoinColumn="country")

params <- mapCountryData(df2,
nameColumnToPlot="blah",
mapTitle="",
xlim=c(-30,30),
ylim=c(-20,40),
borderCol=gray(0),
catMethod="categorical",
colourPalette="rainbow",
missingCountryCol=gray(1))

0 comments on commit 50b55fe

Please sign in to comment.