7.4 Definición del mapa con tmap
#########################################
P1_empleo <- tm_shape(ShapeSAE %>%
inner_join(estimaciones))
brks_ocupado <- seq(0.3,0.8,0.1)
brks_desocupado <- seq(0,0.2,0.05)
brks_inactivo <- seq(0.15,0.6, 0.09)7.4.1 Creando mapa de ocupados
Mapa_ocupado <-
P1_empleo +
tm_fill("Ocupado_mod",
breaks = brks_ocupado,
title = "Ocupado",
palette = "-Blues") +
tm_layout(
legend.only = FALSE,
legend.height = -0.5,
legend.width = -0.5,
asp = 1.5,
legend.text.size = 3,
legend.title.size = 3
)Guardando el mapa de ocupados
tmap_save(
Mapa_ocupado,
outOcupado,
width = 6920,
height = 4080,
asp = 0
)7.4.2 Creando mapa de desocupados
Mapa_desocupado <-
P1_empleo + tm_fill(
"Desocupado_mod",
breaks = brks_desocupado,
title = "Desocupado",
palette = "YlOrRd"
) + tm_layout(
legend.only = FALSE,
legend.height = -0.5,
legend.width = -0.5,
asp = 1.5,
legend.text.size = 3,
legend.title.size = 3)Guardando el mapa de desocupado
tmap_save(
Mapa_desocupado,
outDesocupado,
width = 6920,
height = 4080,
asp = 0
)7.4.3 Creando mapa de inactivo
Mapa_Inactivo <-
P1_empleo + tm_fill(
"Inactivo_mod",
title = "Inactivo",
breaks = brks_inactivo,
palette = "YlGn"
) + tm_layout(
legend.only = FALSE,
legend.height = -0.5,
legend.width = -0.5,
asp = 1.5,
legend.text.size = 3,
legend.title.size = 3)Guardando el mapa de inactivo
tmap_save(
Mapa_Inactivo,
outInactivo,
width = 6920,
height = 4080,
asp = 0
)creando un mosaico.
mosaico <- tmap_arrange(Mapa_Inactivo, Mapa_ocupado,Mapa_desocupado,ncol = 3,
nrow = 1 )guardar mosaico
tmap_save(
mosaico,
outMosaico,
width = 8920,
height = 4080,
asp = 0
)knitr::include_graphics("Rmd/CHL/Recursos/Mosaico_fit_multinomial_con_covariable.png")