This is a simple, minimal example of report written in R markdown. The purpose of this report is two fold:

  1. To enlighten you about the relationship between engine displacement and gas mileage.
  2. Provide an accessible introduction to Literate Programming.

The source of the data is the 1974 Motor Trend USA Magazine.

Next steps:

Engine Displacement

Engine displacement is measured in cubic inches.

1974 Motor Trend US Magazine Engine Displacement (cubic inches)
Engine Displacement N Cars % Cars
0-100 5 15.62
101-200 11 34.38
201 - 300 5 15.62
300+ 11 34.38

Miles Per Gallon

Miles per gallon, or fuel efficiency, is measured in miles to the gallon, because we are in the US.

Scatterplot

Displacement is the independent variable. Gas mileage is the dependent variable. Correlation does not imply causation, except for this time when it does.

Correlation Discussion

Clearly, gas mileage is strongly correlated with engine displacement. But how strong is it? As it turns out, the Pearson’s r is -0.8475514.

Thank you and have a nice darned day.