I was inspired by this bit of code to make a map of Brooklyn bike lanes–the lanes upon which I once biked many a mile.

library(osmdata)
library(dodgr)
library(tidyverse)
library(sf)
library(ggminthemes)
library(tigris)
options(tigris_use_cache = TRUE)

1 Importing and cleaning the street data

## Reading layer `nybb' from data source `/Users/richardmorel/Documents/GitHub/ramorel.github.io/files/nybb_19d/nybb.shp' using driver `ESRI Shapefile'
## Simple feature collection with 5 features and 4 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: 913175.1 ymin: 120121.9 xmax: 1067383 ymax: 272844.3
## epsg (SRID):    2263
## proj4string:    +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs

2 Creating the map