Section 1: mtcars Variables

Here are the 11 variables available in the mtcars dataset:

  • mpg: Miles per gallon
  • cyl: Number of cylinders
  • disp: Displacement (cu.in.)
  • hp: Gross horsepower
  • drat: Rear axle ratio
  • wt: Weight (1000 lbs)
  • qsec: 1/4 mile time
  • vs: Engine type (0 = V-shaped, 1 = straight)
  • am: Transmission (0 = automatic, 1 = manual)
  • gear: Number of forward gears
  • carb: Number of carburetors

Section 2: Fuel Efficiency Formula

\[ mpg = \frac{miles\ traveled}{gallons\ of\ gas} \]

Section 3: Visualization

hist(mtcars$mpg,
     main = "Histogram of MPG",
     xlab = "Miles Per Gallon",
     col = "seagreen",
     border = "black")