title: If loop condition with result from summary() after manova() in R
body: <p>I am running a manova and my code is something like this:</p>
  
  <pre><code>fit &lt;- manova(y ~ grp + cov)
  summary(fit)
  </code></pre>
  
  <p>So the output of summary is:</p>
  
  <pre><code>               Df   Pillai approx F num Df den Df    Pr(&gt;F)    
  grp         2 0.185330   5.6511      6    332 1.322e-05 ***
  age         1 0.110497   6.8323      3    165 0.0002284 ***
  fd          1 0.153049   9.9388      3    165 4.646e-06 ***
  scan        1 0.037374   2.1354      3    165 0.0977272 .  
  Residuals 167                                              
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  </code></pre>
  
  <p>I am having trouble finding a way to extract the 6th element of the 1st column (the p value) so that I can create a conditional if loop to run univariate and post hoc tests on significant models. Hoping to have something like:</p>
  
  <pre><code>p &lt;- [method of obtaining p value(1.322e-05) in this case]
  if (p &lt; 0.017){
  for (i in 1:length(dependentvars){
  univariate tests with aov()
  p.uni &lt;- univariatetestp(same thing as before with obtaining p value)
  if (p.uni &lt;-){
  summary(glht(....
  </code></pre>
  
  <p>Any advice or direction is greatly appreciated.
  Thank you
  -J</p>