Code
library(tidyverse)
library(leaflet)
library(leaflegend)
Naylynn Tañón Reyes
May 4, 2023
To help ease the housing crisis, in 2018 Los Angeles created a law that would limit locals to hosting short-term rentals in their “primary residence,” not in a second home or an investment property. This same law, requires the AirBnB hosts to register with the city which would verify that they meet all requirements.
Despite the regulation, as it currently stands, of the 5089 short-term (<30 days) AirBnB listings 1038 were unlicensed which are shown in red. Meaning, 1 in 5 properties are illegally listed on the platform.
pal_license <- colorFactor(
domain = licensed_la$is_licensed,
palette = "RdBu"
)
city_of_LA_shortterm %>%
leaflet() %>%
addTiles() %>%
addCircleMarkers(
fillColor = ~pal_license(is_licensed),
stroke = TRUE,
weight = 0,
radius = 10,
popup = ~paste0(
neighbourhood
)
) %>%
addLegendFactor(
pal = pal_license,
values = licensed_la$is_licensed
)