[R] Formatting summary() output to a file

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Fri Jul 27 18:56:52 CEST 2018


On Fri, 27 Jul 2018, MacQueen, Don wrote:

> Given your description, I would start with
>
> sink('wysumallyrs.txt')
> print( summary(wyallyrs) )
> sink()
>
> and see if that doesn't meet your needs.

Don,

   I started with sink() trying to follow
<https://stat.ethz.ch/R-manual/R-patched/library/base/html/sink.html> (which
is the same as ?sink within R) using the two examples at the bottom. Neither
used the print() function and the results were an empty file (using example
1) or an error message about incorrect usage (using example 2).

   Your solution does make more sense than does using cat().

Thanks,

Rich




More information about the R-help mailing list