This is my code:
#Duo2 <- read_excel(file.choose()) #Filename:Ryo_Lena_Duo2
#ggplot(data=Duo2) + geom_col(mapping=aes(x=Parameter, y=Erstens, fill=Parameter), show.legend=FALSE) + labs(x=NULL,y="Stimmen")
#Duo2plot <- ggplot(data=Duo2) + geom_col(mapping=aes(x=Parameter, y=Erstens, fill=Parameter), show.legend=FALSE) + labs(x=NULL,y="Stimmen")
ui <- fluidPage(
titlePanel("Ryos und Lenas interaktives Klavierduo"),
sidebarLayout(
sidebarPanel(
selectInput("var", "Abstimmung",
choices=colnames(Duo2)[-1])
),
mainPanel(
plotOutput("Duo2plot"))
)
)
server <- function(input, output) {
output$Duo2plot <- renderPlot({
ggplot(data= Duo2) +
geom_col(mapping=aes_string(
x="Parameter", y= input$var, fill="Parameter"),
show.legend=FALSE) +
labs(x=NULL,y="Stimmen")
})
}
shinyApp(ui = ui, server = server)