title: How to format and move mutiple regression equation for each group in ggplot?
body: <p>I have been searching this for a while but can't get a solution.</p>
  
  <pre><code>This is the data I have 
  Display     Frustration  Neck Angle
  1 Microscope          55 40.77672
  2 Microscope          70 53.74905
  3 Loupe               10 52.41799
  4 Loupe               5  62.36514
  5 Video               25 49.83489
  6 Video               10 68.19686 
  my current code
  
  lm_eqn &lt;- function(df){
   m &lt;- lm(Neck ~ Frustration, df);
    eq &lt;- substitute(italic(y) == a + b %.% italic(x)*","~~italic(r)^2~"="~r2, 
                     list(a = format(coef(m)[1], digits = 2), 
                          b = format(coef(m)[2], digits = 2), 
                          r2 = format(summary(m)$r.squared, digits = 3)))
    as.character(as.expression(eq));                 
  }
  eq &lt;- ddply(df.frus,"Display",lm_eqn)
  p&lt;- ggplot(df.frus,aes(x=Frustration,y=Neck,col=Display))+geom_jitter(width=0.5)+geom_smooth(method="lm",se=FALSE)
  p+geom_text(data=eq,aes(x = 30, y = 80,label=V1), parse = TRUE)
  </code></pre>
  
  <p>Now I am able to generate regression lines and r^2 values for each group, but they are in the same place, how should I format the place of showing these equations?</p>
  
  <p><a href="https://i.stack.imgur.com/zlwt6.png" rel="nofollow noreferrer">My current plot</a></p>
  
  <p>Really appreciate any help!!!!</p>