Lab 3F
Directions: Follow along with the slides and answer the questions in red font in your journal.
R
to create an interactive map of the mtns
data we scraped in Lab 3E.load_lab(23)
command, as an R
script.
load("___.Rda")
leaflet()
function and the mtns
data to create the leaf
that we can use for mapping.mtns_leaf <- leaflet(____)
mtns_leaf
into the addTiles()
function and assign the output the name mtns_map
mtns_map
in the console to look at your basic map with no data displayed.
addMarkers()
function.
addMarkers(map = ____, lng = ~____, lat = ~____)
peak
variable, in a similar way as we supplied the lat
and long
variables, to the popup
argument and include it in the code above.
state
its located.mtns <- mutate(____, state_colors = colorize(____))
mtns_leaf
and mtns_map
to use it.
mtns_leaf
and mtns_map
as you did before.addMarkers
to addCircleMarkers
and keep all of the arguments the same.addCircleMarkers
like before but this time include color = ~state_colors
as an argument.mtns_map
.addLegend(____, colors = ~unique(____), labels = ~unique(____))