Price of Fuel in South Africa

[This article was first published on R | datawookie, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The {saffer} package is a nascent collection of things relating to South Africa. I’ve just added fuel price data.

The {saffer} package can be installed from GitHub.

remotes::install_github("datawookie/saffer")

Then load it up and you’re ready to explore.

library(saffer)

Background

The price of fuel in South Africa is influenced by a number of forces. Some of the most important influences are:

  • International (the Base Fuel Price or BFP) — What does it cost to import fuel?

    • oil price
    • shipping
    • exchange rate
  • Domestic

    • transport
    • wholesale margin
    • retail margin
    • taxes and
    • levies.

The fuel price is controlled by government and is updated on the first Wednesday of every month.

There are four main classes of fuel:

The types of petrol and diesel have evolved over the years with lower octane petrol, unleaded (ULP) and lead replacement (LRP) petrol and reduced sulphur levels in diesel.

Fuel Prices

Fuel price data (what you’d pay at the pumps) is in the fuel_price data frame. The data extend from 4 September 1990 to 6 January 2021 and include the following types of fuel.

fuel_price %>% select(fuel) %>% distinct() %>% arrange(fuel)
# A tibble: 13 x 1
   fuel                   
                     
 1 91 ULP                 
 2 93                     
 3 93 LRP                 
 4 93 ULP                 
 5 95 LRP                 
 6 95 ULP                 
 7 97                     
 8 97 ULP                 
 9 Diesel 0.3%            
10 Diesel 0.05%           
11 Diesel 0.005%          
12 Illuminating Paraffin  
13 Liquefied Petroleum Gas

We’ll ignore the prices of Illuminating Paraffin and Liquefied Petroleum Gas.

Here’s how the price for each of those fuel types has changed over time. Note that there is also differential pricing for coastal and inland areas, with the price being higher inland due to the extra transport costs.

Supporting Data

In addition to the fuel price data there’s some relevant auxiliary data:

  • basic fuel price (fuel_price_basic)
  • price of crude oil (fuel_price_brent_crude) and
  • exchange rate (fuel_price_usd_exchange_rate).

First let’s take a look at the exchange rate and price of crude oil. The South African Rand (ZAR) has fairly consistently depreciated relative to the USD. This is one contribution to the increasing fuel price.

I’ll be adding earlier crude oil prices.

And here are the various components of the Basic Fuel Price.

Conclusion

The motivation for adding these data is that they are going to be used in some analyses that we are doing for Trundler. I hope that you find them useful too.

If R is not your thing, then you can still access these data as CSV files from https://github.com/datawookie/saffer.

To leave a comment for the author, please follow the link and comment on their blog: R | datawookie.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)