How can I warp the default rainbow in R. For instance, take a look at this code and the image it produces:
x = seq(0,50,by=0.005)
y = runif(length(x),2,5)
colors = rainbow(length(x))
plot(x,y,cex=0.2,pch=16,col=colors)

I want to alter this so that there is not so much green. There should be as much green as there is yellow and cyan and blue. I also want to remove magenta (the “redish” color on the far right). How could I go about doing this?
If you skip green explicitly out of the palette generation, you get close to what you want I think:
edit
You could also manually edit each colour transition to make them a different length: