
I am a new R user but a long time SAS user. I searched for a response to this question but no luck, so forgive me if this topic has been covered before. I am running a TukeyHSD post hoc test after running an ANOVA. I get the results of all pairwise comparisons, no problem. However, the output table is a little "busy", and I'd like to make the output easier to read. Specifically, I would like all groups which are not significantly different to be given the same letter. 

For example, here is a simple ANOVA with Tukey post hoc. It compares weight gain in pigs among 4 feeds labeled "A", "B", "C", and "D":

> a = aov(Weight~Feed)
> TukeyHSD(a)
  Tukey multiple comparisons of means
    95% family-wise confidence level

Fit: aov(formula = Weight ~ Feed)

$Feed
      diff        lwr       upr     p adj
B-A   6.68   1.096263 12.263737 0.0168421
C-A   8.73   2.807553 14.652447 0.0034914
D-A  -1.38  -6.963737  4.203737 0.8906642
C-B   2.05  -3.872447  7.972447 0.7530266
D-B  -8.06 -13.643737 -2.476263 0.0041505
D-C -10.11 -16.032447 -4.187553 0.0009497



What I really want would look something like this:

Feed         Mean     TukeyResult
C            73.4           a
B            71.3           a
A            64.6           b
D            63.2           b


Any ideas?
 		 	   		  
	[[alternative HTML version deleted]]

