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
levelplot question
2 messages · Antje, Dieter Menne
Antje <niederlein-rstat <at> yahoo.de> writes:
I have a question concerning the behaviour of the colouring with levelplot. >
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?
You implicitly expect round(). [1] "blue"
col.regions[3.5]
[1] "blue"
col.regions[round(3.5)]
[1] "yellow" Your question implies that you may also susceptible to the problem of R FAQ 7.31, "Why doesn't R think these numbers are equal?" Dieter