[R] color2D.matplot

wragbag p.d.aldridge at ncl.ac.uk
Tue Nov 6 20:48:13 CET 2007


I am a true R novice aonly using it for this function ;)

I am trying to use color2D.matplot to form a image of my data using the
following conditions

color2D.matplot(fi1, c(dr), c(dg), c(db), nslices=7, ylab='Species',
xlab="gene", show.legend=TRUE) where fi1 is my matrix.

I have a matrix with 36 columns and 130 rows. most entries are 1 or 0 and I
am trying to get this function to plot these as either 0 = white or 1 =
black. This is fine but one column contains entries between 0 and 7. I would
entries between 2 and 7 to be different colors (as this is what I am trying
to show although I also need to see the black and white areas) using the
following:

> dr = c(1,0,1,0,0)
> dg = c(1,0,0,1,0)
> db = c(1,0,0,0,1)

I can get some color to work but I cannot get them all as if I but in a c()
range equalling 0-7 (i.e. one color for each number I get the following. I
cannot figure out from the documentation why it will not let me do what I
want :(

Error in rescale(x[segindex], redrange[c(seg, seg + 1)]) : 
  rescale: can't rescale a constant vector!

help please someone...
-- 
View this message in context: http://www.nabble.com/color2D.matplot-tf4760527.html#a13614400
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list