ComenzarEmpieza gratis

Swapping Popups for Labels

Popups are great, but they require a little extra effort. That is when labels come to our aid. Using the label argument in the addCircleMarkers() function we can get more information about one of our markers with a simple hover!

ipeds %>% 
    leaflet()  %>% 
    addProviderTiles("CartoDB")  %>% 
    addCircleMarkers(label = ~name, radius = 2)

Labels are especially helpful when mapping more than a few locations as they provide quick access to detail about what each marker represents.

Este ejercicio forma parte del curso

Interactive Maps with leaflet in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Add circle markers with labels identifying the name of each college
map %>% 
    addCircleMarkers(data = ca, radius = 2, label = ___)
Editar y ejecutar código