knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  error = FALSE, 
  collapse = TRUE,
  comment = "",
  fig.height = 8,
  fig.width = 12,
  fig.align = "center",
  cache = FALSE
)

Instructions

Exercise

I love a sunburnt country

A land of sweeping plains

Of ragged mountain ranges

Of droughts and flooding rains

(From the poem My Country by Dorothea MacKellar)

In this last week there have been many news stories about an ongoing dry period in large parts of Australia. In the west of NSW, large parts of Queensland, and even the Gippsland region of Victoria it is reported that there has been insufficient rain for many months and this is severely affecting many farmers. This assignment is designed to examine what is happening using publicly available data.

Data collection

This is what I have done to get the data to this point. The Global Historical Climate Network maintained by NOAA curates weather records for stations across the globe.

  • You can get the list of stations and their latitude and longitude from the ghcnd-stations.txt file from the raw files site https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/. Australian stations have “ASN” prefixing the station id. There are 17219 recording stations across Australia. Some of them are on Antartica, remote islands, and possibly on Naval ships because the locations of these few are far from the mainland.

  • The data is stored in a single file for each station. The Australian Bureau of Meteorolgy links to this site for Australian data, and you can download station by station from their site, but this is a very inefficient interface. We can get multiple files read by scripting it in R. (You could pay BOM to download your preferred summaries.) I pulled weather data from stations around Victoria as a first pass, and checked the precipitation of the most recent records. It was clear quickly that a lot of stations have not had their data updated recently on this database. So I needed a way to get just the data from stations that had measurements for this year, all the way through to August. The web page with the list of files available for all stations has a “modified date” for each file, so I extracted this information and used it to select only stations in Australia that had data modified this month.

  • The next step is to go file by file, and pull the data for these stations, combine it into a single data file. This is the same as what we did for the Melbourne weather station during a past class.

Your don’t need to repeat what I have done. Start by reading in the data that is already created.

Your tasks

  1. (1pt) Use your web surfing skills and find an article on the CURRENT drought in Australia. Report the link to the article and write a few sentences summarising its main points.

Various possibilities here

  1. (1pt) Read in the raw data and put it into tidy form. The code is provided, with a few spots where you need to fill in the functions. Where you see ??? in the code, is where you need to fill in to make it work.

    1. What value is used in the raw data to indicate a missing value? -9999
    2. Why do the precipitation values divided by something? It was reported in tenths of mm, with the decimal point dropped.
  2. (1pt) Compute the monthly precipitation for each year. (You need to sum up the precipitation for each month, for each year.) When working with precipitation it is important to summarise using totals. This is different from working with temperature, where we would typically summarise using means. Why should you use totals to summarise precipitation?

It is the cumulative precipitation that matters for the environment. This leads to moist ground water for plants to drink, and for accumulation of water in rivers and dams for animals and agriculture to use.

  1. (1pt) Make a line plot of monthly precipitation by month, grouping by station, for 2018. Overlay a smoother. Is there generally a decreasing trend in rainfall this year across the country?

The first few months saw a lot of rain at a few locations. There was less rain in recent months. It is not clear if this is the usual pattern across these stations for the first 7 months of the year.

  1. (1pt) Compute the long term average monthly precipitation for each station. (Use your previous summary and then average the values by month.) This is going to be a baseline for comparing precipitation this year.

Need to show the code for this question.