mastering-shiny icon indicating copy to clipboard operation
mastering-shiny copied to clipboard

Code error in Exercises 5 of "1 Your first Shiny app"

Open liguowei-CAS opened this issue 4 years ago • 1 comments

Thanks for your excellent guidance !

I found some errors during my practice of Exercises 5 of "1 Your first Shiny app".

Here it is:

library(shiny)
library(ggplot2)

datasets <- c("economics", "faithfuld", "seals")
ui <- fluidPage(
  selectInput("dataset", "Dataset", choices = datasets),
  verbatimTextOutput("summary"),
  tableOutput("plot")  # **here should be: plotOutput("plot")**
)

server <- function(input, output, session) {
  dataset <- reactive({
    get(input$dataset, "package:ggplot2")
  })
  output$summmry <- renderPrint({
    summary(dataset())
  })
  output$plot <- renderPlot({
    plot(dataset) # **here should be: plot(dataset())**
  }, res = 96)
}

shinyApp(ui, server)

liguowei-CAS avatar Aug 26 '21 08:08 liguowei-CAS

I came here to report the same thing. It's been a year, and the maintainers haven't done anything about it. Could they at least allow the community to make the necessary changes? Hello? Is anyone listening?

nav9 avatar Sep 01 '22 17:09 nav9