How can I get ggpairs to display ancova results in upper panels?
<p>I'm making a scatterplot matrix with ggpairs{GGally) as follows, but I'd like to display the p values for each term in my aov results in the upper panels, rather than just the overall and by-species correlation value that comes with the package.</p>

<p>How can I get the right column from this aov result into my upper plots? Can I write a custom function to do this, and how? Is is even possible using ggpairs? Thanks.</p>

<pre><code>library(GGally);library(ggplot2)
pm &lt;- ggpairs(data = iris, 
          mapping = aes(color = Species),
          columns = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"))

pm
</code></pre>

<p><a href="https://i.stack.imgur.com/9aCYL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9aCYL.jpg" alt="iris data ggpairs plot"></a></p>

<pre><code>result &lt;- aov(Sepal.Length ~  Sepal.Width*Petal.Length, data = iris)
print(summary(result))

                      Df Sum Sq Mean Sq F value   Pr(&gt;F)    
Sepal.Width                1   1.41    1.41    12.9 0.000447 ***
Petal.Length               1  84.43   84.43   771.4  &lt; 2e-16 ***
Sepal.Width:Petal.Length   1   0.35    0.35     3.2 0.075712 .  
Residuals                146  15.98    0.11                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
</code></pre>