1 | Shiny app pitch - introduction

Try it at https://asheshwor.shinyapps.io/migrationviz/

App screenshot Screenshot of options

@asheshwor | 2014-07-27 

2 | Getting the data

data2013 <- read.xlsx2("data/UN_MigrantStockByOriginAndDestination_2013.xls",
                       sheetName = "Table 10",
                       startRow = 16, colIndex = c(2, 4 , 10:241),
                       colClasses = c("character", rep("numeric", 232)))
wmap <- readShapeSpatial("data/110m_cultural/ne_110m_admin_0_countries.shp")
places <- read.csv("data/cities1000.csv", header=FALSE, stringsAsFactors=FALSE)

3 | Data processing

##   source destination stock lat.d lon.d lat.s lon.s stocklog id
## 1     AD          AU    22   -27   133  42.5   1.5        3  1
## 2     AD          AU    22   -27   133  42.5   1.5        3  1
## 3     AD          AU    22   -27   133  42.5   1.5        3  1
## 4     AE          AU  5890   -27   133  24.0  54.0        9  2
## 5     AE          AU  5890   -27   133  24.0  54.0        9  2
## 6     AE          AU  5890   -27   133  24.0  54.0        9  2
## 7     AE          AU  5890   -27   133  24.0  54.0        9  2
## 8     AE          AU  5890   -27   133  24.0  54.0        9  2

4 | Migrant origin and destination points

More populated cities are more likely to get selected
Cities with higher population are more likely to get selected

5 | Generating the final map

plot of chunk final-plot

An example plot for Australia with 'light' map theme

Try the app at https://asheshwor.shinyapps.io/migrationviz/