Re: [R] heatmap from xyz data

2007-02-06 Thread Vladimir Eremeev

You can use 

plot(y~x,col=color.index.in.palette.defined.from(z),pch=20,type="p")

where 

color.index.in.palette.defined.from(z)

is a function or an expression, returning either a color index in a
predefined palette or any other color representation, suitable for R. This
is described in ?par. 
I have successfuly used col=z*10 with your sample data.

type="p" specifies, that points will be plotted.
pch=20 says to plot them as small filled circles, sometimes I needed smaller
circles, and pch=183 worked for me.

The package fields and several other packages related to the spatial
statistics are able to plot irregularly distributed point data and
interpolate them to a regular grid (produce a 'contiguous' map).

Here are some links:

http://sal.uiuc.edu/csiss/Rgeo/
http://r-spatial.sourceforge.net/

You can also try
RSiteSearch("spatial")
or
help.search("spatial")
from the R console


Trevor Graham wrote:
> 
> 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) coords
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-R--heatmap-from-xyz-data-tf3180966.html#a8827597
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] heatmap from xyz data

2007-02-06 Thread Trevor Graham
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.