Skip to content
Prev 361974 / 398506 Next

Add column to the output of summary(glht).

Hi John,

Two things that can be helpful are to review the structure of the object returned by summary.glht(), which in your code above would be (see ?str):

 str(SumTukey)

and also review the print method for the object that actually generates the console output. In this case, using:

  multcomp:::print.summary.glht

or 

 getAnywhere(print.summary.glht)

will reveal the code that is used to generate the output that you see above. The print method is not exported from the package's namespace. 

You can review the print method code to see which components of 'SumTukey' are then used to create the output and what internal functions are used to do that.

Once you understand the structure of the object and how that object's content is formatted and output for display by the associated print method for the object class, you can modify things to fit your need by creating, if need be, your own functions to modify the required part or parts of the object itself and then output them.

If you want to understand what summary.glht() is doing, take the same approach as above for the print method, since it is not exported either:

  multcomp:::summary.glht

or 

  getAnywhere(summary.glht)


Regards,

Marc Schwartz