# Start coding here...Hotel Campaign Targeting
William Taylor
3/4/2023
About Me
Hi there! My name is William and I've always had a passion for uncovering insights and telling compelling stories through data. With 8 years of professional experience, I've honed by skills in data analysis, visualization, and storytelling to help businesses make informed decisions and achieve their goals. In other words, I data mine for the bottom line.
Some career highlights include:
- Boosting the Sing-Off's television ratings by +33% at Sony Pictures Television
- Reporting a translation error that altered results for a $10K+ study in Poland at MarketCast
- Saving over +$100K in department budget by automating workflows at Tennis Channel
When I'm not exploring datasets, I love to travel internationally, play cooperative/strategy boardgames and learn new languages (programming and spoken!). As a result, my hobbies and work experience have made me great at global collaboration and I'm eager to move to Europe to continue growing my skillset.
Let's work together and turn your data into actionable insights!
install.packages("DataExplorer")
install.packages("tidyverse")
install.packages("countrycode")
install.packages("janitor")
install.packages("vtree")
install.packages("openxlsx")
install.packages("rio")
install.packages("data.table")
install.packages("formattable")
library(DataExplorer)
library(tidyverse)
library(countrycode)
library(janitor)
library(vtree)
library(openxlsx)
library(rio)
library(data.table)
library(formattable)hotels <- read_csv("hotel_demand.csv")
glimpse(hotels)hotels_trimmed <- hotels %>%
select(hotel:lead_time,arrival_date_month,stays_in_weekend_nights,
stays_in_week_nights,country, is_repeated_guest, customer_type, adr)
str(hotels_trimmed)hotels_trimmed %>%
introduce()
hotels_trimmed %>%
plot_intro()
hotels_trimmed %>%
plot_histogram()
hotels_trimmed %>%
plot_bar()
hotels_trimmed %>%
plot_correlation(maxcat = 7)idx <- which(hotels_trimmed$country == "CN")
hotels_trimmed$country[idx] <- "CHN"
idy <- which(hotels_trimmed$country == "TMP")
hotels_trimmed$country[idy] <- "TLS"
hotels_mutated <- hotels_trimmed %>%
mutate(total_night_stays = stays_in_weekend_nights + stays_in_week_nights) %>%
mutate(total_stay_revenue = total_night_stays * adr) %>%
mutate(country_name = countrycode(country, "iso3c", "country.name"))
hotels_mutated$currency_total_stay_revenue <- prettyNum(hotels_mutated$total_stay_revenue, big.mark = ",", symbol = "€")
transient_customers <- c("Transient", "Transient-Party")
transient_hotels <- hotels_mutated %>%
filter(customer_type %in% transient_customers)
transient_hotelspercent_cancelled <- mean(transient_hotels$is_canceled == 1) * 100
percent_cancelled
tabyl(transient_hotels, hotel, is_canceled)
tabyl(transient_hotels, hotel, is_canceled) %>%
adorn_percentages("row") %>%
adorn_pct_formatting(digits = 2)
vtree(transient_hotels, c("hotel", "is_repeated_guest", "is_canceled"),
fillcolor = c( hotel = "#e7d4e8", is_repeated_guest = "#9ecae1", is_canceled = "#99d8c9"),
horiz = FALSE)paid_hotels <- transient_hotels %>%
filter(is_canceled == 0)
paid_hotels %>%
group_by(hotel, is_repeated_guest) %>%
summarize(avg_revenue = mean(total_stay_revenue), sum_revenue = sum(total_stay_revenue))
paid_hotels %>%
summarize(total_sum = sum(total_stay_revenue), count = n())
revenue_percent <- paid_hotels %>%
group_by(hotel, is_repeated_guest) %>%
mutate(percent_revenue = total_stay_revenue/sum(total_stay_revenue)) %>%
summarize(avg_revenue = mean(total_stay_revenue), sum_revenue = sum(total_stay_revenue))
tabyl(revenue_percent, hotel, is_repeated_guest) %>%
adorn_percentages("row") %>%
adorn_pct_formatting(digits = 2)
paid_hotels %>%
group_by(hotel, is_repeated_guest, arrival_date_month) %>%
summarize(avg_revenue = mean(total_stay_revenue), sum_revenue = sum(total_stay_revenue), avg_lead_time = mean(lead_time), count = n()) %>%
arrange(-avg_revenue)