Section 1

The mtcars data set was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

The data set has the following variables:

  • 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

Section 2

You can calculate the row mpg with the formula \[ row\quad mpg = \frac{miles\;travelled}{gallons\;of\;gas} \]

Section 3

A simple visualisation of the histogram of the mpg variable is created.