Aesthetics must be either length 1 or the same as the data (7):

Viewed 38

shiny, currently having this error while trying to plot a ggplot, however, every answer online is saying that this is caused by the colour selection, while I didn't even put the colour selection in the code. Below is my code & data, Thanks for all the help! enter image description here

server <- function(input, output, session) {
  output$plot_race <- renderPlot({
    ggplot(data= race_shoot, aes_string(x='race',
                                 y=input$year)) +
      geom_bar(stat='identity', width=0.5) +
      labs(x='race', y=input$year)
  })
}
0 Answers
Related