1 Section 1

Here is the list of the variables included in the mtcars dataframe.

  • mpg Miles/(US) 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 (0 = V-shaped, 1 = straight)
  • am Transmission (0 = automatic, 1 = manual)
  • gear Number of forward gears
  • carb Number of carburetors

2 Section 2

This is the formula to calculate the Miles per gallon. \[ mpg = \frac{miles\;traveled}{gallons\;of\;gas} \]

3 Section 3

This is the visualization of the miles per gallon for the cars included in the mtcars dataset.

hist(mtcars$mpg, main = "mpg of mtcars data", ylab = "number of cars", xlab = "Miles per gallon")