cannot coerce type 'environment' to vector of type 'character'

Hello,

Having some difficulties with the following code:

library(shiny)
ui <- fluidPage(diamonds,
ggplot(data = diamonds, aes(x = price, y = table, colour = color )) +
geom_line())
server <- function(input, output, session) {
}
shinyApp(ui, server)

This code was successfully run when I ran it without the shiny elements.
However, when I add the shiny elements that are necessary to make a shiny app the application will launch but the text on screen reads " cannot coerce type 'environment' to vector of type 'character'

thank you

The code doesn't work simply because you are using a wrong code structure for your shiny app, I recommend you to familiarize yourself with the basics of a Shiny apps.

https://mastering-shiny.org/

1 Like