Objectives
Create a web page using R Markdown that features a map created with Leaflet. Host your webpage on either GitHub Pages, RPubs, or NeoCities.
Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity!
Review Criteria The rubric contains the following two questions:
1.-Does the web page feature a date and is this date less than two months before the date that you’re grading this assignment?
Sys.time()
## [1] "2026-04-24 10:50:29 -05"
Sys.Date()
## [1] "2026-04-24"
First, loading the packages and libraries.
# Instalar los paquetes básicos necesarios
install.packages("ggplot2", repos = "https://cloud.r-project.org")
##
## There is a binary version available but the source version is later:
## binary source needs_compilation
## ggplot2 3.5.1 4.0.3 FALSE
install.packages("leaflet", repos = "https://cloud.r-project.org")
##
## There is a binary version available but the source version is later:
## binary source needs_compilation
## leaflet 2.2.2 2.2.3 FALSE
install.packages("sf", repos = "https://cloud.r-project.org")
##
## There is a binary version available but the source version is later:
## binary source needs_compilation
## sf 1.0-20 1.1-0 TRUE
# Cargar las librerías para empezar a trabajar
library(ggplot2)
library(leaflet)
library(sf)
2.- Does the web page feature an interactive map that appears to have been created with Leaflet?
mi_mapa <- leaflet() %>%
addTiles() %>% # Añade el mapa base (OpenStreetMap)
addMarkers(lng = -79.8862, lat = -2.1919,
popup = "Guayaquil: La Perla del Pacífico") %>%
addPopups(lng = -79.8862, lat = -2.18, "¡Hola desde R!")
mi_mapa