Write R code to read in the global temperature data that has been stored in three different formats: plain text, XML, and netCDF.

Your code should create a data frame in R from each disk file and the resulting data frames should all be the same, right down to the data type of each variable in the data frame.

To check whether your answer is correct, load the "model answer", which is provided in an R binary format. The following code loads the variable 'glbModel' into an R session ...

    load("GLB.rda")
    

... and the first few lines of that data frame look like this ...

> head(glbModel)
  Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec J-D D-N DJF MAM JJA SON
1 1880  28  10  -9 -15 -12 -55 -21   3   8 -39 -33  -3  NA  NA  NA -12 -25 -21
2 1881 -54  -3 -15   8  21 -86  -5  -8 -14 -16 -17  27 -14 -16 -20   4 -33 -16
3 1882  79  41  26 -34 -13 -65 -55 -17  25 -12   8  -1  -2   1  49  -7 -46   7
4 1883 -15 -54  -4  16  -2  55  18  -1 -31 -15 -40  13  -5  -6 -23   3  24 -29
5 1884 -19  10 -25 -75 -75 -48 -56 -12 -22 -41 -61 -86 -43 -34   1 -58 -39 -42
6 1885 -57 -47 -55 -47 -38 -58 -12   6 -11  26 -26  35 -24 -34 -63 -47 -21  -4 
    

You should use the following expression to test that your data frame, 'glbxml' say, is exactly the same as the model answer ...

    all(mapply(identical, glbxml, glbModel))
    

The result of that expression should be 'TRUE'.

The assignment is due at the fourth lecture (9:00am Friday November 9). It is worth double marks (compared to the other assignments).

Submit your assignment by emailing it to me.