Assign color to lines ggplot2
<p>I would like to do a line plot with 5 different line using ggplot2. I used the following code.</p>

<pre><code>plot &lt;- ggplot() + 
  geom_line(data=MS, aes(x=date, y=MSCI.World.PI, color='MS')) +
  geom_line(data=S, aes(x=date, y=SandP.TR, color='S')) +
  geom_line(data=BR, aes(x=date, y=MSCI.BRIC.PI, color='BR')) +
  geom_line(data=HF, aes(x=date, y=HFRX, color='HF')) +
  geom_line(data=LP, aes(x=date, y=LPX50.TR, color='LP')) +
  scale_color_manual(values = c("red", "blue", "green", "yellow", "violet" )) +
  labs(color="Indices") +
  xlab('Time') +
  ylab('Price')
plot
</code></pre>

<p>The result is the following plot:
<a href="https://i.stack.imgur.com/kHLMp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kHLMp.png" alt="Corresponding Plot"></a></p>

<p>The "wrong" part is, that the colors did not get sorted as was intended, meaning the first line ("MS") is not assigned to the first color ("red"). It seems like the line get assigned to the colors alphabetically. </p>

<p>Is there any way that I can change the assignment in such way that the first line is assingned to the first color ins the scale_color_manuel statement, the second line to the second color and so forth?</p>