[R] Z score in gplots

David Winsemius dwinsemius at comcast.net
Mon Jul 30 19:30:20 CEST 2012

On Jul 29, 2012, at 9:49 PM, Khush gg wrote:

> Hi,
> Can anyone tell me how to set Z-score according to my own  
> requirement as
> the below code is taking as per the file entries. Any help would
> be appreciable.

That was a bit vague and hard to parse, but I'm thinking I may need to  
make allowance for a non-native speaker. The help page for heatmap.2  
has an example that demonstrates changing the color palette to  
'bluered'. If you run that that example and then look at the output,  
you should see that the 'breaks' value is returned and is on a Z-scale  
as a result of setting the scale argument ... as you may already  
understand. Since there is also a "breaks" argument, that would appear  
to be the setting you should be modifying.

> library(gplots)
> x=read.table("final.txt", header=TRUE)

However, ...  you have not provided a reproducible example, and that  
is not something I make much allowance for:

 > x=read.table("final.txt", header=TRUE)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
   cannot open file 'final.txt': No such file or directory

So I cannot offer a tested example. If you need further commentary  
perhaps you could use the help page examples as a starting point for  
further discussion rather than offering code that will surely fail.

> snipped code.

> Thank you in advance
> K>S
> 	[[alternative HTML version deleted]]
Please do not ignore the boilerplate message:

> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
Alameda, CA, USA

More information about the R-help mailing list