[R] levelplot question

Dieter Menne dieter.menne at menne-biomed.de
Mon May 4 15:42:13 CEST 2009

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?"


More information about the R-help mailing list