Suppose I want to plot a vector in R with different colors. I write:
x <- 1:10
plot(x,col=x)
or,
x <- 1:5
plot(x,col=x)
From the plot see that in both the cases "red" is the second color which R chooses, black being the first. I want to make "red" the first.
Please note that defining 5 or 10 colors is not the solution since 5 and 10 are arbitrary numbers.
Any help would be helpful.
My original problem was defining user specific colors in ggplot2 using:
aes(color=factor(Variable))
In this I wanted to make red the first color.