Beyond sink() - capturing messages to file and stdout [🇷 for BE/BA]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2017-09-02 07:20 (2425 d 19:46 ago) – Posting: # 17761
Views: 4,715

Hi ElMaestro,

the meaning of 'stdout'? outputs on the console? If yes, you can try

zz<- file("output.txt",open="wt")
sink(zz,split=TRUE)  ### this will send output to the file and on the console simultaneously
...
sink(zz,split=FALSE)  ### this will send all outputs to the file only, but will not be on the console;default for sink(), same as sink(zz).
sink() ### this will temporarily stop sending output to the file; console output is still on.
sink(zz,split=TRUE) ### re-activate sink() again;
close(zz) ### close the output; use it before q(); otherwise, the output text file may not be complete.

I am not quite sure if I answer your question correctly or not.

All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here

Complete thread:

UA Flag
Activity
 Admin contact
22,993 posts in 4,828 threads, 1,655 registered users;
63 visitors (0 registered, 63 guests [including 6 identified bots]).
Forum time: 03:06 CEST (Europe/Vienna)

So far as I can remember,
there is not one word in the Gospels
in praise of intelligence.    Bertrand Russell

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5