[R] levelplot question

Antje niederlein-rstat at yahoo.de
Mon May 4 13:35:57 CEST 2009


Hi there,

I have a question concerning the behaviour of the colouring with levelplot. (I 
hope, I manage to explain)

If I give the parameters "at" and "col.regions" like this:

at <- c(1,2,3,4,5,6)
col.regions <- c("blue","blue","blue","yellow","yellow","yellow")

Which color would have the value 3.5?
I would have expected yellow, no?

In my more complex example I wanted to create a heatmap (like yellow to red) up 
to a fixed threshold. All values above should get another color (like blue).
Automatically, I generated both vectors like this:

at <- 		c(vectorOfLowerValues, myThreshold, vectorOfHigherValues)
col.regions <-  c(vectorOfHeatmapColors, lastHeatmapColor, vectorOfColor"blue")

But I get some values above the threshold which are not blue... Can anybody 
explain me why? (I've checked the length of both vectors and it's parts - this 
is correct - so 'myThreshold' would get 'lastHeatmapColor' by the same vector 
position)

I'm very confused...

Antje




More information about the R-help mailing list