Get startedGet started for free

The City of Colleges

Based on our map of California colleges it appears that there is a cluster of colleges in and around the City of Angels (e.g., Los Angeles). Let's take a closer look at these institutions on our leaflet map.

The coordinates for the center of LA are provided for you in the la_coords data frame.

la_coords <- data.frame(lat = 34.05223, lon = -118.2437) 

Once you create a map focused on LA, try panning and zooming the map. Can you find the cluster of colleges East of LA known as the Claremont Colleges?

When there are hundreds of markers, do you find the pin markers helpful or do they get in your way?

The coordinates of LA have been provided in the la_coords data frame and the ca data frame of California colleges and the map have been loaded for you.

This exercise is part of the course

Interactive Maps with leaflet in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Center the map on LA 
map %>% 
   addMarkers(data = ca) %>% 
    ___(lat = la_coords$lat, lng = la_coords$___, zoom = 12)
Edit and Run Code