Creating new table from existing table in R
<p>I have an existing data set table. For example, the table is called Table1</p>

<pre><code>         V1   V2            V3 
1      S301  OR     1575.3078990  
2      S301 AND     1006.5031070  
3      S301  OR      938.3647756  
4      S302  OR     1106.0894270  
5      S302 AND     1239.9842820  
6      S302  OR     885.3624568 
</code></pre>

<p>I'd like to reorganise this table into a new one where column V2 is split into 'And' and ' Or' columns, with the values being 
the mean of all the 'And' for S301 in table 1 V2 in the 'And' column<br>
and mean for all the 'OR' for S301 in table 1 V2 in the 'Or column'.</p>

<p>I've been struggling with this for so long so any help would be greatly appreciated! Thank you all so much in advance.</p>