title: How to control legend with many groups
body: <p>I have a plot like this:</p>
  
  <p><a href="https://i.stack.imgur.com/R1yC0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R1yC0.png" alt="enter image description here"></a></p>
  
  <p>Which was created with this code:</p>
  
  <pre><code># Make data:
  set.seed(42)
  n &lt;- 1000
  df &lt;- data.frame(values = sample(0:5, size = n, replace = T, prob = c(9/10,  rep(0.0167,5))), 
                   group  = rep(1:100, each = 10), 
                   fill2  = rep(rnorm(10), each = 100),
                   year   = rep(2001:2010, times = 100)
                   )
  df$values &lt;- ifelse(df$year %in% 2001:2007 == T, 0, df$values)
  
  # Plot
  require(ggplot2)
  p &lt;- ggplot(data = df, aes(x = year, y = values, colour = as.factor(group))) + geom_line()
  p
  </code></pre>
  
  <p>Since there are so many groups, the legend is really not helpfull. 
  Ideally I would like just two elements in the legend, one for group = 1 and for all the other groups (they should all have the same color). Is there a way to force this? </p>