Mapas Interactivos en R
Mapas Animados
Mapas en 3D
# step 1. load municipality & add the dengue cases ####
library(sf)
x <- rgeomex::AGEM_inegi19_mx |>
dplyr::filter(CVE_ENT %in% c("30")) |>
dplyr::mutate(casos = rpois(n = dplyr::n(),
lambda = 4))
# Step 2. plot the map with R base ####
plot(x["casos"],
key.pos = 4,
axes = TRUE,
graticule = TRUE,
key.width = .2,
key.length = .8)
# step 1. load municipality & add the dengue cases ####
library(sf)
x <- rgeomex::AGEM_inegi19_mx |>
dplyr::filter(CVE_ENT %in% c("30")) |>
dplyr::mutate(casos = rpois(n = dplyr::n(),
lambda = 4))
# Step 2. plot the map with ggplot2 ####
ggplot2::ggplot() +
ggplot2::geom_sf(data = x,
ggplot2::aes(fill = casos)) +
fishualize::scale_fill_fish() +
ggspatial::annotation_scale(location = "bl") +
ggspatial::annotation_north_arrow(location = "tr")
# step 1. load municipality & add the dengue cases ####
library(sf)
x <- rgeomex::AGEM_inegi19_mx |>
dplyr::filter(CVE_ENT %in% c("30")) |>
dplyr::mutate(casos = rpois(n = dplyr::n(),
lambda = 4))
# Step 2. plot the map with tmap ####
library(tmap)
tmap::tm_shape(x) +
tmap::tm_polygons(col = "casos") +
tmap::tm_compass(position = c(.2, .9)) +
tmap::tm_scale_bar(position = c(.1, .02))
email : felipe.dzul.m@gmail.com
celular : 9999580167
slides: https://calm-hummingbird-41cb33.netlify.app/talks/spatial_data/#/