Car mileage can be hard to guess.
This app estimates miles per gallon (mpg) from a car’s weight and number of cylinders.
Car mileage can be hard to guess.
This app estimates miles per gallon (mpg) from a car’s weight and number of cylinders.
The estimate updates when you change an input.
The app uses the built-in mtcars dataset and a simple prediction model.
For example, here is the estimate for a car weighing 3,000 pounds with 4 cylinders:
model <- lm(mpg ~ wt + cyl, data = mtcars) round(predict(model, data.frame(wt = 3, cyl = 4)), 1)
## 1 ## 24.1
Try the app: https://ragha.shinyapps.io/carmileageapp/