Mapas de Bolivia

Vamos a generar mapas de Bolivia.

maps
Bolivia
bioinformatic
Author
Affiliation

AgriTech Bolivia

Published

February 1, 2023

Mapas

Introduccion

El paquete rnaturalearth es una herramienta excelente para mantener y facilitar la interacción con los datos cartográficos de Natural Earth. Para producir mapas con ggplot2, se necesitan los siguientes paquetes.

library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ purrr   1.0.0 
✔ tibble  3.1.8      ✔ dplyr   1.0.10
✔ tidyr   1.2.1      ✔ stringr 1.5.0 
✔ readr   2.1.3      ✔ forcats 0.5.2 
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
library(rnaturalearth)
# America del sur
sam = ne_countries(continent = "south america",
                   returnclass = "sf",
                   scale = 50)
p1 = ggplot() +
  geom_sf(data = sam, fill = "white") +
  theme_light() +
  xlim(c(-90, -35))

# Imagen de Bolivia y destacar La Paz

bolivia = ne_states(country = "bolivia", returnclass = "sf") %>%
  mutate(scat = ifelse(postal == "LP", "La Paz", "Otros"))

p2 = 
  p1 +
  geom_sf(data = bolivia, aes(fill = scat))
p2

Citation

BibTeX citation:
@online{santos2023,
  author = {Santos, Franklin},
  title = {Mapas de {Bolivia}},
  date = {2023-02-01},
  url = {https://franklinsantosm.com/posts/maps},
  langid = {en}
}
For attribution, please cite this work as:
Santos, Franklin. 2023. “Mapas de Bolivia.” February 1, 2023. https://franklinsantosm.com/posts/maps.