[R] source output differs from console output

Jun Yan jyan at stat.wisc.edu
Sat Oct 26 06:37:10 CEST 2002


On Fri, 25 Oct 2002, graham lawrence wrote:

> 
> Dear R-help,
> I would like to be able to run the following code sequence as a source 
> routine.
> If I paste it into R via the clipboard it works as expected, but if I source 
> the code instead then the last 3 statements fail.
> I've also tried writing to the file in place of the sink sequence, but that 
> also hits a snag.  R 1.6, w98e2, dfr is a data frame containing the content 
> of Julian Faraway's gala data frame.  I append the console log and 3 outputs 
> to the file.

`write' can write a data object (matrix or data.frame) out to a
file. `sink' can divert R output of any R object to a file. The error in
your code occurs when you try to `write' a summary object out. I think
`sink' may be enough for your need.

Jun Yan

Department of Statistics          Office: CSSC 4252
university of Wisconsin-Madison   Tel: (608)262-7478 
1210 W. Dayton St.                Email: jyan at stat.wisc.edu
Madison, WI 53706                 URL: http://www.stat.wisc.edu/~jyan




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list