title: ggplot2 draw individual ellipses but color by group
body: <p>I have data that consists of several data points for a number of individuals, and each of these individuals is from a particular study site. I'd like to plot all points, draw 95% ellipses for each individual, but then color the ellipses by study site. Unfortunately it seems that when I specify to color by site, the ellipse is drawn for the aggregated group.</p>
  
  <p>The data look like this:</p>
  
  <pre><code>dat1 &lt;- data.frame(X=rnorm(21),Y=rnorm(21),indiv_id=rep(c(1,2,3),7),group_id=rep(1,21))
  dat2 &lt;- data.frame(X=rnorm(21,5),Y=rnorm(21,5),indiv_id=rep(c(4,5,6),7),group_id=rep(2,21))
  dat3 &lt;- data.frame(X=rnorm(21,10),Y=rnorm(21,10),indiv_id=rep(c(7,8,9),7),group_id=rep(3,21))
  ggdat &lt;- rbind(dat1,dat2,dat3)
  ggdat$indiv_id &lt;- as.factor(ggdat$indiv_id)
  ggdat$group_id &lt;- as.factor(ggdat$group_id)
  </code></pre>
  
  <p>If I draw ellipses by individual, I can see all of the ellipses separately:</p>
  
  <pre><code>ggplot(ggdat) +
    geom_point(aes(x=X, y=Y,color=indiv_id),size=1) + # 
    stat_ellipse(aes(x=X, y=Y,color=indiv_id),type = "norm")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/evM0V.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/evM0V.jpg" alt="individual ellipses"></a></p>
  
  <p>but if I draw by the group, it makes just one ellipse per group:</p>
  
  <pre><code>ggplot(ggdat) +
    geom_point(aes(x=X, y=Y,color=indiv_id),size=1) + # 
    stat_ellipse(aes(x=X, y=Y,color=group_id),type = "norm") + #, linetype = 2
    theme(legend.position='none')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/IFf5Q.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/IFf5Q.jpg" alt="group ellipses"></a></p>
  
  <p>How can I draw all 9 ellipses but color them by group? Thanks for the help!</p>