airbnb_plot <- airbnb |>filter(!is.na(price)) |>filter(price >0) |>filter(price <1000) |>filter(room_type %in%c("Private room", "Entire home/apt", "Hotel room")) |>ggplot(aes(x = room_type, y = price, fill = room_type)) +geom_boxplot(alpha =0.7) +labs(title ="Price Distribution by Room Type in Washington D.C.",x ="Room Type",y ="Price per Night (USD)",caption ="Data source: Airbnb DC 2025 dataset",fill ="Room Type" ) +scale_fill_manual(values =c("Entire home/apt"="skyblue","Private room"="lightgreen", "Hotel room"="salmon" )) +theme_minimal() +coord_cartesian(ylim =c(0, 500))print(airbnb_plot)
This boxplot visualizes the price distribution for the three most common types of Airbnb listings in Washington, D.C.: entire homes/apartments, private rooms, and hotel rooms. A key insight is that entire homes and hotel rooms have higher median prices compared to private rooms, which are generally more affordable for budget-conscious travelers. Additionally, entire home/apartment listings show the widest price range, indicating a greater variety of luxury and budget options within this category. This suggests that travelers looking for consistent, budget-friendly options would likely find the most predictable prices with private rooms.
Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
Running Code
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
1+1
[1] 2
You can add options to executable code like this
[1] 4
The echo: false option disables the printing of code (only output is displayed).