0

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)
  })
}
kkkkllll
  • 1
  • 1
  • 1
    Welcome to SO! It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including in your case a minimal working app code and a snippet of your data or some fake data. If you want to post your data type `dput(NAME_OF_DATASET)` into the console and copy the output starting with `structure(....` into your post. – stefan Sep 23 '22 at 05:29
  • Please do not post an image of code/data/errors [for these reasons](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557). Just include the code, console output, or data (e.g., dput(head(x)) or data.frame(...)) directly. – stefan Sep 23 '22 at 05:29

0 Answers0