Thank you Chuck. This is really neat! I just learned that we can unlist thing. 
- adschai----- Original Message -----From: Chuck Cleland Date: Sunday, July 1, 
2007 4:53 amSubject: Re: [R] How to save results from chisq.test or 
mantelhaen.test to fileTo: [EMAIL PROTECTED]: r-help@stat.math.ethz.ch> [EMAIL 
PROTECTED] wrote:> > Hi,> > > > I am new to these functions. I'm wondering if 
there is anyway > to save the entire results (all attributes of the result 
object) > from the chisq.test or mantelhaen.test functions? For example, > from 
chisq.test function, you will have statistic, parameter, > p.value, expected, 
etc. in the result list. How can I save all > of them in one shot to, says, a 
text file or csv file? Thank you.> > > > - adschai> >  You could unlist() the 
result, coerce it to a data frame, then use> write.table().  For example, 
something like this:> > 
write.table(as.data.frame(t(unlist(chisq.test(InsectSprays$count > > 7,> 
InsectSprays$spray)))), quote=FALSE)!
 > > or> > write.table(as.data.frame(unlist(chisq.test(InsectSprays$count > 7,> 
 > > InsectSprays$spray))), quote=FALSE)> > > 
 > > ______________________________________________> > R-help@stat.math.ethz.ch 
 > > mailing list> > https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do 
 > > read the posting guide http://www.R-> project.org/posting-guide.html> > 
 > > and provide commented, minimal, self-contained, reproducible code.> > -- > 
 > > Chuck Cleland, Ph.D.> NDRI, Inc.> 71 West 23rd Street, 8th floor> New 
 > > York, NY 10010> tel: (212) 845-4495 (Tu, Th)> tel: (732) 512-0171 (M, W, 
 > > F)> fax: (917) 438-0894>

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to