M.Bandini Airbnb Homework

library(readxl)
library(ggplot2)
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(readxl)
df <- read_excel("Airbnb_DC_25.csv")
df_filtered <- df |>
  group_by(room_type) |>
  summarize(count = n())
ggplot(df_filtered, aes(x = room_type, fill = room_type))

ggplot(df_filtered, aes(x = room_type, fill = room_type)) +
  geom_bar()

ggplot(df_filtered, aes(x = room_type, fill = room_type)) +
  geom_bar() +
  labs(
    title = "Number of Entire Home Listings in DC",
    x = "Room Type",
    y = "Count"
  )

ggplot(df_filtered, aes(x = room_type, y = count, fill = room_type)) +
  geom_col() +
  scale_y_continuous(breaks = seq(0, 5000, by = 500)) +
  labs(
    title = "Airbnb Listings in DC by Room Type",
    x = "Room Type",
    y = "Count",
    fill = "Room Type",
    caption = "Data source: Airbnb_DC_25.csv"
  ) +
  theme_minimal()

The bar chart shows the number of room types available in Washington DC in 2025. I created a visualization to show how many of each room type there are. Interestingly, most places rent out the entire home, but a small yet significant amount also offer private rooms. Each room type is a different color to make it easier to read.