Warning: package 'shiny' was built under R version 4.4.3
MTCARS Explorer
Interactive filtering and display of the classic mtcars dataset.
# 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])
})