Week 2 Developer Data product exercise
library(leaflet)
library(here)
Map the Boston Area
- Boston coordinates and zoom around Boston metropole only
my_map <- leaflet() %>%
addTiles() %>%
setView(lng=-71.0589, lat=42.3601 , zoom=12)
my_map
Load MBTA stops data
- Using here package for relative path instead of hardcoding mine
- Since the total size is more than 9000 points and it takes time to render, I create a smaller dataset of 500 rows
- Using here package for relative path instead of hardcoding mine
mbta_stops=here::here("MBTA_GTFS", "stops.txt")
stops = read.csv(mbta_stops)
sample_data <- stops[c(1:500),]