’sup libraries?
library(here)
library(tidyverse)
’sup data?
brands <- read.csv("brands.csv")
burn_times <- read.csv("burn_times.csv")
materials <- read.csv("materials.csv")
purchases <- read.csv("purchases.csv")
Joining the tables.
location_times <- brands %>%
inner_join(burn_times)
## Warning in inner_join(., burn_times): Detected an unexpected many-to-many relationship between `x` and `y`.
## ℹ Row 1 of `x` matches multiple rows in `y`.
## ℹ Row 1 of `y` matches multiple rows in `x`.
## ℹ If a many-to-many relationship is expected, set `relationship =
## "many-to-many"` to silence this warning.
location_times
Recalculating splines.
location_times <- location_times %>%
select(brand_location,session_time) %>%
group_by(brand_location) %>%
summarize(total_time = sum(session_time))
location_times
Now let’s make the visual!
viz <- location_times %>%
arrange(total_time) %>%
mutate(brand_location=factor(brand_location,levels=brand_location)) %>%
ggplot(aes(fill=brand_location,x=brand_location,y=total_time)) + geom_bar(stat="identity", col="brown") + theme(axis.title = element_blank(), legend.position = "none") + labs(title = "Hours by Brand Location", subtitle = "Data by Candlegraph")
viz
Look at LA go!