This project presents a simple Shiny application that explores the relationship between car transmission type and fuel efficiency (MPG) using an interactive interface.
December 24, 2025
This project presents a simple Shiny application that explores the relationship between car transmission type and fuel efficiency (MPG) using an interactive interface.
Many users want to know whether automatic or manual cars give better mileage. This app makes it easy to understand MPG differences visually and numerically.
# Load dataset
data(mtcars)
# Convert transmission to factor with labels
mtcars$am <- factor(mtcars$am, labels = c("Automatic", "Manual"))
# Calculate average MPG by transmission type
avg_mpg <- aggregate(mpg ~ am, data = mtcars, mean)
avg_mpg
## am mpg ## 1 Automatic 17.14737 ## 2 Manual 24.39231