R create table from 3 columns
<p>I failed about 10 approaches on this:</p>

<p>I have a data formatted in 3 columns:</p>

<pre><code>H7  200,3   2227649,5
H13 200,3   1084585
H15 200,3   873123,1
Zdrowy  200,3   2245707
Z26 202,7   1742185,9
Zdrowy  202,7   2420348,5
K4  203,5   10251587
Z18 203,5   6904013
H7  203,5   5765803
H13A    203,5   4219047,5
H13 203,5   1791847,1
H15 203,5   1260959,3
K3  203,5   9878843
K5  203,5   3406241
K35 203,5   4746493
K37 203,5   6303874
Z11 203,5   1415927,8
Z16 203,5   6245137,5
Z26 203,5   7330417,5
</code></pre>

<p>columns 1 and 2 do contain values that are not unique. What I need to do with this is to get a matrix with column1 as row names, column2 as column names and column3 as the corresponding values in the cells. If the value is duplicated (since columns 1,2 have some non unique values) cell value should be an average.</p>

<p>Any help with that?</p>