Read in the data on soil core samples from the plain text file cores.txt. You should get something like this:

> cores
       Lab.id       PC1       PC2        PC3
1  MAT077.2.5  2.438455 -1.011183 -3.0408814
2  MAT098.7.5 10.691206  4.767695 -1.7194669
3 MAT081.12.5  8.215852  4.645793  0.9740202
4 MAT083.17.5 10.004222  3.516213  2.5867427
5 MAT014.22.5 18.491651  5.143032  0.4726360
6 MAT094.27.5 18.312555  4.255320  0.8029027
7   MAT084.35 11.758186 -0.325388  3.4456731
8   MAT041.45  6.043985 -3.297326  3.0752216
    

The first variable in this data set, 'Lab.id', consists of a core ID of the form "MATnumber.value", where number is a three digit number and value is a real value, possibly including a decimal point.

Your task is to process the variable 'Lab.id' to separate out the core ID from the value. You should end up with something like this:

> newcores
      V1   V2       PC1       PC2        PC3
1 MAT077  2.5  2.438455 -1.011183 -3.0408814
2 MAT098  7.5 10.691206  4.767695 -1.7194669
3 MAT081 12.5  8.215852  4.645793  0.9740202
4 MAT083 17.5 10.004222  3.516213  2.5867427
5 MAT014 22.5 18.491651  5.143032  0.4726360
6 MAT094 27.5 18.312555  4.255320  0.8029027
7 MAT084 35.0 11.758186 -0.325388  3.4456731
8 MAT041 45.0  6.043985 -3.297326  3.0752216
    

There are many possible ways to perform this task; you should submit at least two different solutions (one of which should involve a regular expression).

The assignment is due at 9:00am (Austrian time) Friday November 30.

NOTE: the overall project is due 9:00am (Austrian time) Friday December 7.

Submit your assignment by emailing it to me.