[R] heatmap from xyz data
Trevor Graham
trevor.graham at ucl.ac.uk
Tue Feb 6 15:38:44 CET 2007
Hi,
I've got some data in a data frame arranged like this:
x y z othervariables ....
0.1 0.2 1.7 0.01 ....
0.2 0.2 1.3 0.23 ....
0.2 0.3 1.1 0.43 ....
etc
I'd like to plot a heatmap of this data, with x and y as the (x,y) co-
ords and z defining the colour at each point.
I'm having difficulty finding the correct functions to use. Can
anyone make any recommendations?
It seems straightforward to make the plot using the image function if
the data is in matrix form, but I'm not sure how to transform my xyz
data into matrix form.
Many thanks in advance for your help.
Best wishes,
Trevor
-------------------------------------------------------------
Trevor Graham
Centre for Mathematics and Physics in the Life Sciences and
Experimental Biology (CoMPLEX)
Cancer Research UK
CoMPLEX, Wolfson House
University College London, Gower Street
London WC1E 6BT, UK
Tel: +44 (0)20 7679 5088
Internal: 25088
http://trevor.complex.ucl.ac.uk
More information about the R-help
mailing list