title: Add p-value and R2 ggplot [follow-up]
body: <p>It is a follow-up <a href="https://stackoverflow.com/questions/37536950/ggplot2-add-p-values-to-the-plot/39331729#39331729">question</a>. When I run the code given below, I get warning message that I think is due to no facets requirement in my code while the source code mentioned in link included facets. Have a look and please let me know which part needs to be amended.  Looking forward!</p>
  
  <p>Code: </p>
  
  <pre><code>library(dplyr) 
  library(ggplot2)
  library(ggpmisc)
  
  df &lt;- diamonds %&gt;%
    dplyr::filter(cut%in%c("Fair","Ideal")) %&gt;%
    dplyr::filter(clarity%in%c("I1" ,  "SI2" , "SI1" , "VS2" , "VS1",  "VVS2")) %&gt;%
    dplyr::mutate(new_price = ifelse(cut == "Fair", 
                                     price* 0.5, 
                                     price * 1.1))
  
  
  p &lt;- ggplot(df, aes(x,y, color=factor(cut))) 
  p &lt;- p + stat_smooth(method = "lm", formula = y ~ x-1, size = 1, level=0.95) 
  p &lt;- p + geom_point(alpha = 0.3) 
  p &lt;- p + stat_poly_eq(aes(label = paste(..rr.label..)),
                        label.x.npc = "right", label.y.npc = 0.15, formula = formula, 
                        parse = TRUE, size = 3) + 
            stat_fit_glance(method = 'lm', method.args = list(formula = formula),
                        geom = 'text', aes(label = paste("P-value = ", 
                        signif(..p.value.., digits = 4), sep = "")),label.x.npc = 'right',
                        label.y.npc = 0.35, size = 3)
  print(p)
  </code></pre>
  
  <p>Warning messages:</p>
  
  <p>1: Computation failed in <code>stat_poly_eq()</code>:
  object of type 'closure' is not subsettable </p>
  
  <p>2: Computation failed in <code>stat_fit_glance()</code>:
  object of type 'closure' is not subsettable</p>