i want combine selectinput with renderplot(ggplot). I want to make bar (plot)chart the year and month I choose. if i choose select year(yil) 2009 and select month(ay) 2 , plot be like must show my selects. this is like filter maybe i dont know how to solve this problem. year and month value inside my datagrid , i shared my data picture
my ui.R ;
library(shiny)
library(ggplot2)
shinyUI(fluidPage(
titlePanel(title=h4("Norvec Arac Satıs Verisi 2007-2016",align="center")),
sidebarLayout(
sidebarPanel(
selectInput("yil","1.Yıl Seçiniz",
choices = list("2007"=1,"2008"=2,"2009"=3,"2010"=4,"2011"=5,"2012"=6,"2013"=7,"2014"=8,"2015"=9,"2016"=10)),
sliderInput("ay","2. Ay Seçiniz",min = 1,max = 12,value = 1,step = 1,
animate = animationOptions(interval=800,loop = FALSE, playButton = "OYNAT", pauseButton = "DUR"))
),
mainPanel(
tabsetPanel(type="tab",
tabPanel("Grafik",plotOutput("bar"))
)
)
)
))
my server.R ;
library(shiny)
library(ggplot2)
library(dplyr)
shinyServer(function(input,output){
output$bar <- renderPlot({
ggplot(data=carsales,aes(x = Brand, y = Quantity, group = Brand, color = Brand, fill=Brand)) +
geom_bar(stat = "identity")
})
})
shiny:

mydata:

mydata :
> head(carsales)
Year Month Brand Quantity
1 2007 1 Toyota 2884
2 2007 1 Volkswagen 2521
3 2007 1 Peugeot 1029
4 2007 1 Ford 870
5 2007 1 Volvo 693
6 2007 1 Skoda 665