Description Usage Arguments Value See Also Examples
Function which plots the map of Colombia and the aggregated results per level desired.
1 | PlotMapColombia(x, x.graph, id.nivagre, nivagre, n = 10, divipola, ShapesCol)
|
x |
|
x.graph |
Name of the variable contained in |
id.nivagre |
Variable which contains the identification codes as per the desired disaggregation |
nivagre |
Desired municipal (‘mpio’), departmental (‘dpto’), or certified territorial entity ('ETC') desired aggregation levels. |
n |
Number of categories into which the variable |
divipola |
|
ShapesCol |
Shapes of the political-administrative division of Colombia |
The map of Colombia as a ggplot
object.
divipola, etc2013, ggmap, ggplot2, ShapesCol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | data('cal.muni')
data(divipola)
data(ShapesCol)
PlotMapColombia(x = cal.muni[,c('mpio','prom')], x.graph = 'prom',
id.nivagre = 'mpio', nivagre = 'mpio',
divipola = divipola, ShapesCol = ShapesCol)
dpto.prom <- aggregate(cal.muni[,'prom'], list(dpto = cal.muni[['dpto']]), mean)
PlotMapColombia(x = dpto.prom, x.graph = 'x', id.nivagre = 'dpto',nivagre = 'dpto',
divipola = divipola, ShapesCol = ShapesCol)
etc.prom <-aggregate(cal.muni[,'prom'],list(etc = cal.muni[['codETC']]), mean)
mapCol <- PlotMapColombia(x = etc.prom,x.graph = 'x',id.nivagre = 'etc',
nivagre = 'ETC',divipola = divipola,
ShapesCol = ShapesCol)
subSanAndres <- mapCol + xlim(c(165298, 171000)) + ylim(c(1884070, 1897000)) +
guides(fill = "none") + labs(title = "")
subCatalina <- mapCol + xlim(c(205000, 210389)) + ylim(c(1975000, 1984871)) +
guides(fill = "none") + labs(title = "")
require(grid)
grid.newpage()
print(mapCol)
vp <- viewport(width = 0.1, height = 0.2, x = 0.02, y = 0.75, just = c("left", "bottom"))
print(subSanAndres, vp = vp)
vp <- viewport(width = 0.1, height = 0.2, x = 0.15, y = 0.75, just = c("left", "bottom"))
print(subCatalina, vp = vp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.