[R] Exporting nlme summary

David Winsemius dwinsemius at comcast.net
Fri Aug 6 00:36:59 CEST 2010


On Aug 5, 2010, at 6:22 PM, Jun Shen wrote:

> I believe this has been discussed many times in the archives. Here is
> one way to do it.

Yes, you are so right.
>
> Use function "sink" to direct the output to a file you specify
>
>> sink( file='your file.txt')
> after you execute this command, all the output will be saved to your
> file and you won't see it on the screen. Say
>> summary(horton.nlme)
>
> give the output back to console
>> sink()

And one line that is equivalent to those three lines:

capture.output( summary(horton.nlme) , file='your file.txt')

--  
David.
>
> Hope this helps.
>
> Jun Shen
> Senior Pharmacokineticist
> Seventh Wave Labs
>
> On Thu, Aug 5, 2010 at 2:30 PM, Ronald Wendt <rnldwendt at gmail.com>  
> wrote:
>> I'm trying to export the results of my summary data for the object
>> horton.nlme, but failing miserably.  Running summary(horton.nlme)  
>> works
>> fine, but both write.table and write.csv return the error "cannot  
>> coerce
>> class 'c("summary.lme", "nlme", "lme")' into a data.frame".
>>
>> I know I can copy and paste the output from the summary function,  
>> but it's
>> ugly because the spacing between numbers and fields is minimal.
>>
>> Thanks for any help!


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list