Example Data Sets

Some data sets provided for exercises.

Example from SPSS

Download File

Source: Kaggle

Weekly Fuel Prices

Average weekly fuel prices in the UK. The data have been downloaded from GOV.UK and slightly modified.

The dataset is in csv format (comma separated values) and can be imported into R as a data frame. The columns in the data frame are

  • date: Date of weekly summary
  • petrol: Petrol pump price in pence per litre
  • diesel: Diesel pump price in pence per litre
  • petrol_dr: Petrol duty rate in pence per litre
  • diesel_dr: Diesel duty rate in pence per litre
  • petror_vat: Petrol VAT as percentage rate
  • diesel_vat: Diesel VAT as percentage rate

You can dowload the data from this link and store it in your working directory. Alternatively you can download it directly from your running session by using following command:

download.file(
    url = "https://coachingr.kamapu.net/Ressourcen/Data/fuel-prices.csv",
    destfile = "fuel-prices.csv", method = "curl")

After that, import the data in your session.

fuel_prices <- read.csv("fuel-prices.csv")
head(fuel_prices)
        date petrol diesel petrol_dr diesel_dr petrol_vat diesel_vat
1 09/06/2003  74.59  76.77     45.82     45.82       17.5       17.5
2 16/06/2003  74.47  76.69     45.82     45.82       17.5       17.5
3 23/06/2003  74.42  76.62     45.82     45.82       17.5       17.5
4 30/06/2003  74.35  76.51     45.82     45.82       17.5       17.5
5 07/07/2003  74.28  76.46     45.82     45.82       17.5       17.5
6 14/07/2003  74.21  76.41     45.82     45.82       17.5       17.5