── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2) library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
library(patchwork)
I created a grouped bar chart specifically comparing the average calculated rooms that are available during the year with the calculated host listing count made. One pattern I notice mainly that people are more likely to make their room reservations in the beginning of the year, while the rooms are less likely to be available at the start of the year. While in the other side of the graph there are two main outliers at the end of the year with a much higher likelyhood of being available to be reserved. Leading me to infer that the two variables might be inversely related, where in the beginning of the year where people make more reservations, the less likely will there be rooms during the beginning of the year to be available for other potential guests. Similarly, to the amount of reviews, it seems to be inversely correlated to the availability of the rooms, since more people go to the same room may share similar experience and less likely to share. In contrast to when people are more likely to share about experience in new places like the new rooms available to people who have not yet experienced it.
airbnb_data <-read_excel("Airbnb_DC_25.csv")grouped_airbnb_data <- airbnb_data %>%group_by(calculated_host_listings_count) %>%summarise(Availability =mean(availability_365, na.rm =TRUE), Reviews =mean(reviews_per_month, na.rm =TRUE) *30) %>%pivot_longer(cols =c(Availability, Reviews), names_to ="Legend", values_to ="value" )airbnb_barchart <-ggplot(grouped_airbnb_data, aes(x =factor(calculated_host_listings_count), y = value, fill = Legend)) +geom_col(position ="dodge", color ="black", width =0.7) +scale_fill_manual(values =c("skyblue", "coral")) +labs(title ="Comparison of Room Availability vs Previous Reviews",x ="Calculated Host Listings Count",y ="Availability of Rooms in the Year 2025 + Reviews From Previous Hosts",caption ="From the Airbnb DC 2025 Data Set" ) +theme_minimal()ggplotly(airbnb_barchart)