I have a CSV file and I'd like to reshape the first 3 columns into a matrix. I have a data.frame that looks like this.
x a 1 
x b 2 
x c 3 
y a 3 
y b 3 
y c 2 
I want this in matrix form so I can feed it to heatmap to make a plot. The result should look something like:
    a    b    c
x   1    2    3
y   3    3    2
I have tried cast from the reshape package and I have tried writing a manual function to do this but I do not seem to be able to get it right.
The CSV file is very large (900mB) and in the first column there's a lot of x,y,z's so to speak.
 
    