-
-
Save adamcone/d16d68723bee568336dcc4da4aa2ccbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r, echo = TRUE, warning = FALSE, message = FALSE} | |
# now I'll try out this function on the filtered data | |
#------------------------------------------------------ | |
sales_bar = mutate(sales_f, Bin_Number = bin_numbers(DateTime, 13)) %>% | |
group_by(., Bin_Number) %>% | |
summarise(., Bin_Sale_Total = sum(Sale_Total)) | |
# now, I'll plot the result | |
ggplot(data = sales_bar, aes(x = Bin_Number)) + | |
geom_bar(aes(weight = Bin_Sale_Total)) + | |
theme_bw() + | |
labs(title = "Revenue vs. Time (clean data)", | |
x = "Time (6-month bins)", | |
y = "Revenue ($)" | |
) + | |
theme( | |
axis.text.x = element_blank(), | |
axis.ticks.x = element_blank() | |
) + | |
scale_y_continuous(limits = c(0, 7e5)) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment