title: Error in TukeyHSD in R
body: <p>I'm working on mixed design ANOVA and would like to run TukeyHSD for its post-Hoc test.<br>
  I keep getting error, "Error in UseMethod("TukeyHSD") : 
    no applicable method for 'TukeyHSD' applied to an object of class "c('aovlist', 'listof')".  </p>
  
  <p>I've seen several questions about this errors in some F&amp;Q websites, but I still cannot find a solution.  </p>
  
  <p>My dataset looks like this:</p>
  
  <pre><code>    subject response  time group
  1       S1  0.99676 time1 task1
  2       S2  1.00220 time1 task1
  3       S3  1.00420 time1 task1
  4       S4  0.99467 time1 task1
  5       S5  0.97906 time1 task1
  6       S6  0.99162 time1 task1
  7       S7  0.99771 time1 task1
  8       S8  1.01780 time1 task2
  9       S9  0.98682 time1 task2
  10     S10  0.99124 time1 task2
  11     S11  1.01670 time1 task2
  12     S12  0.99769 time1 task2
  13     S13  1.02090 time1 task2
  14     S14  1.01740 time1 task2
  15     S15  0.98851 time1 task3
  16     S16  1.00690 time1 task3
  17     S17  0.99717 time1 task3
  18     S18  0.98945 time1 task3
  19     S19  1.00270 time1 task3
  20     S20  1.02690 time1 task3
  21     S21  1.00050 time1 task3
  22      S1  0.96908 time2 task1
  23      S2  0.94024 time2 task1
  ......
  </code></pre>
  
  <p>Then, the anova result is:</p>
  
  <blockquote>
    <p>anova = aov(response~(group*time)+Error(subject/time),data)
    summary(anova)</p>
  </blockquote>
  
  <pre><code>Error: subject
        Df  Sum Sq  Mean Sq F value Pr(&gt;F)
  group      2 0.00381 0.001907   0.701  0.509
  Residuals 18 0.04896 0.002720               
  
  Error: subject:time
         Df  Sum Sq  Mean Sq F value   Pr(&gt;F)    
  time        3 0.08205 0.027351   42.80 2.68e-14 ***
  group:time  6 0.00272 0.000454    0.71    0.643    
  Residuals  54 0.03451 0.000639                     
  </code></pre>
  
  <p>If I run TukeyHSD:</p>
  
  <blockquote>
    <p>TukeyHSD(anova)<br>
        Error in UseMethod("TukeyHSD") : 
          no applicable method for 'TukeyHSD' applied to an object of class "c('aovlist', 'listof')"</p>
  </blockquote>
  
  <p>Is anything wrong with my command or dataset?
  I know this is a very primary question... but if anyone could help me, it would be appreciated! Thanks.</p>