PlotMapColombia: Plot map of Colombia

Description Usage Arguments Value See Also Examples

Description

Function which plots the map of Colombia and the aggregated results per level desired.

Usage

1
PlotMapColombia(x, x.graph, id.nivagre, nivagre, n = 10, divipola, ShapesCol)

Arguments

x

data.frame

x.graph

Name of the variable contained in x to be graphed on the map.

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 x.graph is divided.

divipola

data.frame which lists the territorial división in Colombia.

ShapesCol

Shapes of the political-administrative division of Colombia

Value

The map of Colombia as a ggplot object.

See Also

divipola, etc2013, ggmap, ggplot2, ShapesCol

Examples

 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)

stalynGuerrero/multisae documentation built on May 30, 2019, 8:44 a.m.