10/7/2020

Slide with R Output

As you can see you can use the pipe operator to pipe a data frame directly into leaflet().

Now we’ve nicely mapped out all of the Johns Hopkins campus locations around the city of Baltimore. You can customize text pop ups by including any valid HTML code in a vector. Then you can provide that vector as the popup argument in addMarkers() like so:

Each Johns Hopkins campus location now has a pop up with a link to the website for its respective campus!

Drawing

## Assuming "lng" and "lat" are longitude and latitude, respectively
summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00