[R] Script Run Output Capturing

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Dec 23 16:54:42 CET 2021


?sink explicitly says:

"sink diverts R output to a connection (and stops such diversions)"

Is this not exactly what you requested? If not, why not? Have you
tried it to see?

Bert Gunter

On Thu, Dec 23, 2021 at 5:28 AM Stephen H. Dawson, DSL via R-help
<r-help using r-project.org> wrote:
>
> Nice! Thanks for the reply.
>
> I will research over the next few days.
>
> https://www.ssc.wisc.edu/~hemken/Rworkshops/interface/savingoutput.html
>
> How about the sink() and capture.output() functions? Have you ever used
> them?
>
>
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com <http://www.shdawson.com>
>
>
> On 12/23/21 6:44 AM, Rasmus Liland wrote:
> > Dear Stephen,
> >
> > Maybe running R in batch mode is what
> > you're after?  E.g. running
> >
> >       R CMD BATCH ./process/script-name.r
> >
> > creates ./process/script-name.Rout (or
> > ./process/script-name.rout ?) with
> > output of R commands and inline output,
> > I think stderr (maybe others?  Not only
> > stdout like tee ...
> > https://en.wikipedia.org/wiki/Standard_streams )
> >
> > Note, the batch output is overwritten,
> > as opposed to being appended to (the tee
> > -a flag) the next time you run that line
> > again ...
> >
> > Best,
> > Rasmus
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> >
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list