Created
May 10, 2016 18:00
-
-
Save adamcone/9376e93fb30965fb6a96e7ec1a672c28 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
library(shiny) | |
library(dplyr) | |
library(ggplot2) | |
source("./helpers.R") | |
load("./shinydataframe.RData") | |
server <- function(input, output) { | |
data <- eventReactive(input$go, {items_filter(items_tbl, | |
input$Price_Range_selected, | |
input$Payment_Types_selected, | |
input$Days_of_Week_selected, | |
input$Times_of_Day_selected | |
)} | |
) | |
output$Revenue_Plot <- | |
renderPlot({ | |
ggplot(data = data(), | |
mapping = aes(Date_Bin, | |
Revenue_Total | |
) | |
) + | |
theme_bw() + | |
ggtitle("Open Produce Revenue vs. Time") + | |
geom_bar(stat = "identity", | |
width = 1, | |
color = "white") + | |
scale_x_continuous(name = "\nDate", | |
breaks = seq(from = 0.5, | |
to = 20.5, | |
length.out = 8), | |
labels = c("Jul '09", | |
"Jul '10", | |
"Jun '11", | |
"May '12", | |
"Apr '13", | |
"Mar '14", | |
"Feb '15", | |
"Jan '16") | |
) + | |
scale_y_continuous(name = "Revenue ($)") | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment