Re: [R] writing summary() to a text file

2007-11-26 Thread Mike Prager
Federico Calboli <[EMAIL PROTECTED]> wrote: > > I would like to output the results of a function into a text file, > legible as a such. The function produces a summary quite like: > Take a look at the sink() function. Does that do what you need? -- Mike Prager, NOAA, Beaufort, NC * Opinion

Re: [R] writing summary() to a text file

2007-11-26 Thread Gabor Grothendieck
Also, this works: s <- summary(iris) capture.output(s, file = "myfile.txt") and the Hmisc and xtable packages can output it in latex: library(xtable) print(xtable(s), file = "myfile.tex") library(Hmisc) latex(s, file= "myfile.tex") On Nov 26, 2007 9:59 AM, John Kane <[EMAIL PROTECTED]> wrote:

Re: [R] writing summary() to a text file

2007-11-26 Thread Richard . Cotton
> I would like to output the results of a function into a text file, > legible as a such. The function produces a summary quite like: > > summary(lm(x ~ y + w * z)) You can either redirect output to a file using cat or sink; generate a latex table using xtable (in the xtable package); or export

Re: [R] writing summary() to a text file

2007-11-26 Thread jim holtman
?capture.output On Nov 26, 2007 9:31 AM, Federico Calboli <[EMAIL PROTECTED]> wrote: > Hi All, > > I would like to output the results of a function into a text file, > legible as a such. The function produces a summary quite like: > > summary(lm(x ~ y + w * z)) > > [for instance] > > and I am not

Re: [R] writing summary() to a text file

2007-11-26 Thread John Kane
Would something like this do it? sink(file="reg.txt") summary(reg) sink() --- Federico Calboli <[EMAIL PROTECTED]> wrote: > Hi All, > > I would like to output the results of a function > into a text file, > legible as a such. The function produces a summary > quite like: > > summary(lm(x ~ y

[R] writing summary() to a text file

2007-11-26 Thread Federico Calboli
Hi All, I would like to output the results of a function into a text file, legible as a such. The function produces a summary quite like: summary(lm(x ~ y + w * z)) [for instance] and I am not clear how to save this summary into a text file 'automagically', because I need to be able to do i