Commands for colouring in categories in R in different colours?
I need to colour in some categories in the same colour in a boxplot in R but have no clue how to do so. There are 8 categories and i need 4 of them in one colour, 2 in another colour and the remaining two one colour each. The problem i have is that they are not in order, i.e. 1,5-one colour, 3,4,6,8 one colour and then 7-one colour and 2-one colour. ANY HELP?????
You can use the col argument to boxplot:
boxplot(count~spray, data=InsectSprays, col=c("white", "green", "green", "white", "blue", "yellow"))