License for Short-term Rentals

news
code
analysis
Author

Naylynn Tañón Reyes

Published

May 4, 2023

How many AirBnB listings are unlicensed in Los Angeles?

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.

Code
library(tidyverse)
library(leaflet)
library(leaflegend)
Code
losangeles <- read_csv("http://data.insideairbnb.com/united-states/ca/los-angeles/2023-03-07/visualisations/listings.csv") |>
  sf::st_as_sf(coords = c("longitude", "latitude")) |>
  sf::st_set_crs(4326)
Code
licensed_la <- losangeles %>% 
  mutate(
    is_licensed = ifelse(is.na(license), "no", "yes")
  )
Code
city_of_LA_shortterm <- licensed_la %>%
  filter(
    neighbourhood_group == "City of Los Angeles",
    minimum_nights < 30
  )  
Code
# no_license <- sum(is.na(city_of_LA_shortterm$license))
# license <- sum(!is.na(city_of_LA_shortterm$license))
# 
# no_license / (license + no_license)
Code
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
  )