So you should use write.csv, but first you have to determine what part(s) of the result you need to export, see Susanne message about isolating data frames from the result and the documentation of the function you are using.
You may also use str( yourresult) to see its structure.and guess the name of the data frames you are looking for.
Hi Carl, it depends what format the object is in. Text files can be created with write.table(object, file="filename.txt") and csvs with wrie.csv(object, file="filename.csv"). Search help(write.table) for all options.
For larger objects you could clear the workspace of everything except the object you want to save with rm(list=ls()[ls()!="object"]) and then save the workspace with save.image().
For an easy-to-read text format output, I recommend write.table(object, ...) as others did. But for a binary output of minimized file size, I'd recommend saveRDS(object, ...) instead of save(...), because saveRDS and readRDS allow to "write a single R object to a file, and to restore it" (R help). Definitely more convenient than the save function. Furthermore, it has an option to compress the binary data that's written to disk.
I have an object after performing TukeyHSD. Although when I try to use write functions (write.table, write.csv, or write.xsl), I get promted by an error saying "cannot coerce class 'c("TukeyHSD", "multicomp")' into a data.frame"
Carl, if you'd tell us what format you wish to export the object into, it would be much easier to give you a suitable answer. Already, many people proposed good methods to save any R object in ascii (dput, save, saveRDS) or binary (save, saveRDS with ascii=F) format. But if you want to export something similar to the (formatted) console output you showed us, Thierry's answer is, for the moment, the more appropriate way to do. So, please clarify your need.
So you should use write.csv, but first you have to determine what part(s) of the result you need to export, see Susanne message about isolating data frames from the result and the documentation of the function you are using.
You may also use str( yourresult) to see its structure.and guess the name of the data frames you are looking for.
It seems that you have a list of TukeyHSD test objects. You can use the following code to create a data.frame from such a list, which can be saved as .csv:
# create a list of TukeyHSD test object from dummy data: