I am attempting to create a column chart which has a variable "Hall" represented for their totals across months. I had some help with the code but I ran it it is putting all of the halls on top of eachother as a stacked column chart as opposed to dodged. Any ideas?
Here's what I've tried.
library(tidyverse)
fall2 <- structure(list(Hall = c("1959E", "1959E", "1959E", "1959E", "1959E",
"2109 F", "2109 F", "2109 F", "2109 F", "2109 F"), Month = c("August",
"December", "November", "October", "September", "August", "December",
"November", "October", "September"), total = c(2, 4, 5, 11, 8,
1, 3, 8, 7, 4)), row.names = c(NA, -10L), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"), vars = "Hall", drop = TRUE, indices = list(
0:4, 5:9), group_sizes = c(5L, 5L), biggest_group_size = 5L, labels =
structure(list(Hall = c("1959E", "2109 F")), row.names = c(NA, -2L),
class = "data.frame", vars = "Hall", drop = TRUE))
fall2$Month <- fall2$Month %>%
fct_relevel("August", "September", "October", "November", "December")
fall2 <- fall2 %>%
arrange(Month, -total) %>%
mutate(order = row_number())
#something like this?
ggplot(fall2, aes(order, total)) +
geom_col(aes(fill = total), position = "dodge") +
guides(fill=FALSE) +
ggtitle("Fall Events by Hall") +
facet_wrap(~Month, nrow = 1, scales = "free_x") +
scale_x_continuous(breaks = fall2$order, labels = fall2$Hall,expand = c(0,0))
I would like it to look like 2 halls for each month, not stacked. It has to be a small error I feel.