Created
November 3, 2020 22:17
-
-
Save jbkunst/b6f21d82926576b6da698f9dfeba9706 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(readxl) | |
dbip <- read_xlsx("data/pcma20201028oficio-47702013.xlsx", skip = 7) | |
# como leer más de una hoja | |
# readxl::excel_sheets() | |
# readxl::excel_sheets("data/pcma20201028oficio-47702013.xlsx") | |
dbip | |
glimpse(dbip) | |
dbip <- dbip %>% | |
mutate( | |
LONGITUD = as.numeric(LONGITUD), | |
LATITUD = as.numeric(LATITUD) | |
) | |
# nombres con espacio se debe utilizar con la tilde de acento grave | |
dbip <- dbip %>% | |
mutate( | |
atiende_sabado = str_detect(`HORARIO REFERENCIAL`, "Sab|Sáb|SAB|SÁB") | |
) | |
dbip | |
glimpse(dbip) | |
saveRDS(dbip, "data/dbip.rds") | |
# saveRDS(list(dbip, c(12312, 123)), "") | |
# exploracion leaflet | |
library(leaflet) | |
data("quakes") | |
# Show first 20 rows from the `quakes` dataset | |
leaflet(data = quakes[1:20,]) %>% | |
addTiles() %>% | |
addMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag)) | |
leaflet(data = dbip[1:20,]) %>% | |
addTiles() %>% | |
addMarkers(~LONGITUD, ~LATITUD, | |
popup = ~as.character(ENTIDAD), | |
label = ~as.character(ENTIDAD) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment