knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

perumapas

Lifecycle: experimental CRAN status

The goal of perumapas is to have an easy way to draw maps with peruvian shapes.

Installation

You can install the released version of perumapas from the calderonsamuel r-universe with:

install.packages("perumapas", repos = 'https://calderonsamuel.r-universe.dev')

Example

This is a basic example which shows you how to solve a common problem:

# messages were removed
library(perumapas) # usar siempre junto con sf
library(sf) # obligatorio!
library(ggplot2) # for plotting
library(dplyr) # for filtering

You can create maps easily.

mapa_distrital %>% 
  filter(departamento == "LIMA", provincia == "LIMA") %>% 
  ggplot() +
  geom_sf()

mapa_distrital has avaiable the ubigeo field to easily join/merge with another dataset.

head(mapa_distrital, 10)

To learn how to use mapa_regional and mapa_provincial see vignette('basic-usage').

Shapefiles source

The shapefiles for mapa_distrital were obtained from https://www.geogpsperu.com/2019/05/limite-distrital-actualizado-inei.html



calderonsamuel/perumapas documentation built on Dec. 19, 2021, 12:53 p.m.