Hi,
I am using colorRamp in the following way. I am *sure* there is a
better way to do this, so if you'd be so kind to show me the true R way:
Step 0: Create a new variable, say, "x", that maps some other
continuous variable I have onto the [0,1] line.
Step 1: Store the result from colorRamp (a function), into, say,
"test"
> test <- colorRamp(mypalette)
Step 2: In my data frame, "data"
> data$colorTemp <- test(data$x)
Step 3: Write a new function
bob <- function(temp) { rgb(temp[1],temp[2],temp[3],maxColorValue=255) }
Step 4:
> for (i in 1:dim(data)[1]) data[i,"color"] <- bob(data[i,
"colorTemp"])
Step 5:
map("states", region=data$region, fill=T, col=data$color)
Thanks in advance!
Rick