library ( foreign )
library ( rworldmap )
library ( dplyr )
Mapping Islam
I wanted to see how much Islam has spread into the Middle East and Europe over the last 100 years. The Association for Religion Data Archives just added a terrific dataset that has a lot of historical data regarding the world’s religious demography. The title is: U.S. Religion Census: Religious Congregations and Membership Study, 2010. A link to the dataset is here.
states <- read.dta ( "D:/religstates.dta" , convert.factors = FALSE )
The syntax to create the map is below:
states1900 <- subset ( states , year == 1900 )
gtdMap1900 <- joinCountryData2Map ( states1900 ,
nameJoinColumn = "abbrev" ,
joinCode = "ISO3" )
## 80 codes from your data successfully matched countries in the map
## 107 codes from your data failed to match with a country code in the map
## 163 codes from the map weren't represented in your data
mapCountryData ( gtdMap1900 ,
nameColumnToPlot = 'muspct' ,
catMethod = 'fixedWidth' ,
numCats = 9 , mapTitle = 'Muslim Percentage in 1900' , missingCountryCol = 'white' , oceanCol = 'lightblue' , mapRegion = 'eurasia' )
I repeated this syntax for 1910, 1920, etc. to 2010.
## 81 codes from your data successfully matched countries in the map
## 108 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
## 82 codes from your data successfully matched countries in the map
## 103 codes from your data failed to match with a country code in the map
## 161 codes from the map weren't represented in your data
## 82 codes from your data successfully matched countries in the map
## 104 codes from your data failed to match with a country code in the map
## 161 codes from the map weren't represented in your data
## 82 codes from your data successfully matched countries in the map
## 105 codes from your data failed to match with a country code in the map
## 161 codes from the map weren't represented in your data
## 81 codes from your data successfully matched countries in the map
## 110 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
## 81 codes from your data successfully matched countries in the map
## 112 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
## 81 codes from your data successfully matched countries in the map
## 109 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
## 81 codes from your data successfully matched countries in the map
## 107 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
## 82 codes from your data successfully matched countries in the map
## 104 codes from your data failed to match with a country code in the map
## 161 codes from the map weren't represented in your data
## 81 codes from your data successfully matched countries in the map
## 104 codes from your data failed to match with a country code in the map
## 162 codes from the map weren't represented in your data
I took those 11 images and used an online tool to create an animated gif. That website is GifMaker
A final version of the animated gif can be found at IMGUR