help to display an histogram from text input value

Hello
I try to update an histogram from the value entered in a input text
The value correspond to "mpg" field from the mtcars.csv file
something like this

  
  ui <- fluidPage(
    textInput("caption", "Caption", "Data Summary"),
    verbatimTextOutput("value")
  )
  
  server <- function(input, output) {
    output$value <- renderPlot({ input$caption })
    data <- read.csv("mtcars.csv", header=TRUE)
    value    <- data$mpg
    
    # draw the histogram with the specified number of bins
    hist(value, breaks = bins, col = 'green', border = 'white', xlab = 'mpg value', main = 'Histogram of JP', axes = TRUE, plot = TRUE)
  })
  
  shinyApp(ui, server)
}

Is anybody can help please?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.