Dan Mailman
  • In-Progress
  • Published
  • Data Analyses

MTCARS Explorer

Interactive filtering and display of the classic mtcars dataset.
library("shiny")
Warning: package 'shiny' was built under R version 4.4.3
# UI input: filter by miles per gallon
sliderInput("mpg", "Filter by MPG:",
            min = min(mtcars$mpg),
            max = max(mtcars$mpg),
            value = c(15, 30))
# Server output: filtered table
renderTable({
  subset(mtcars, mpg >= input$mpg[1] & mpg <= input$mpg[2])
})
 

© 2024 Dan Mailman CC BY-SA 4.0