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!
The rubric contains the following two questions:
Hey, this is Andy. This map is my half-year life. That documents the places and their frequncy for me to go.
# Package loading
pacman::p_load(knitr, leaflet, dplyr)
# Dataset preparing
df = data.frame(lat = c(32.93,
32.95,
32.99,
32.70,
32.98,
32.99),
lng = c(-96.74,
-96.72,
-96.73,
-96.80,
-96.74,
-96.73),
name = c('BJ International Auto LLC',
'Good Forturn Supermarket',
'Tom Thumb Sumpermarket',
'Papa Conveniecne Store',
'The University of Texas at Dallas',
'Marquis at Waterview'),
freq = c(1,
24,
30,
72,
5,
180))
glimpse(df)
Rows: 6
Columns: 4
$ lat <dbl> 32.93, 32.95, 32.99, 32.70, 32.98, 32.99
$ lng <dbl> -96.74, -96.72, -96.73, -96.80, -96.74, -96.73
$ name <fct> BJ International Auto LLC, Good Forturn Supermarket, Tom Thumb...
$ freq <dbl> 1, 24, 30, 72, 5, 180
# Basic mapping
df %>% leaflet() %>% addTiles() %>% addMarkers(popup = df$name)
# Advanced mapping
df %>%
leaflet() %>%
addTiles() %>%
addCircles(weight = 1,
radius = df$freq * 10)