[R] gradient generation

Annemarie Verkerk annemarie.verkerk at mpi.nl
Wed Jul 6 08:19:56 CEST 2011

Dear R-help subscribers;

I have a question regarding making gradients in R. I've searched on the 
web, but was only able to find functions that make a gradient between 
color X and Y, which is not what I want.

I want to 'pick out' individual, smaller pieces of a gradient based on a 
range of numbers. Say that I have a range of numbers, leading from 0 to 
1. Then I want 0 to refer to the brightest red, and 1 to the brightest 
blue, and all values in between refer to shades of purple. (So, 0.5 
would be regular purple, 0.7 would be a quite bluish purple, etc.)

Then, I want to be able pick out a gradient from the larger 0-1 
gradient, say for instance the gradient between 0.25 and 0.35 and refer 
to this with an object name for further use.

I'm not sure whether this is possible - maybe it would only be possible 
to define a range of individual R colors first that already form a 
gradient, and then 'pick out' the colors that you want to make the 

In any case, I'm sure one could do this somehow in R!

Thanks for your help,

Annemarie Verkerk, MA
Evolutionary Processes in Language and Culture (PhD student)
Max Planck Institute for Psycholinguistics
P.O. Box 310, 6500AH Nijmegen, The Netherlands
+31 (0)24 3521 185

More information about the R-help mailing list