[R] Opposite color in R

Atte Tenkanen attenka at utu.fi
Sat Jul 25 21:49:55 CEST 2015


Hi,

I have tried to find a way to find opposite or complementary colors in R.

I would like to form a color circle with R like this one: 
http://nobetty.net/dandls/colorwheel/complementary_colors.jpg

If you just make a basic color wheel in R, the colors do not form 
complementary color circle:

palette(rainbow(24))
Colors=palette()
pie(rep(1, 24), col = Colors)

There is a package ”colortools” where you can find function opposite(), 
but it doesn’t work as is said. I tried

library(colortools)
opposite("violet") and got green instead of yellow and

opposite("blue") and got yellow instead of orange.

Do you know any solutions?

Atte Tenkanen



More information about the R-help mailing list