ElMaestro ★★★ Denmark, 2017-09-02 01:23 (2792 d 00:57 ago) Posting: # 17760 Views: 6,390 |
|
Hi all, I would like to capture all messages from R (optionally all R input and output) to a file while at the same time having them on stdout as usual. The sink() function can do either, but apparently (??) not both simultaneously which is what I'd like to use. I have no idea where to start, actually. Note: This involves shelling R under windows so stdout is stdout whether or not it is captured via a pipe into a GUI.Alternatively, if there were a method assiciated with q() or quit() which would upon termination save all stdout info (messages+input+output; what you see on a console when you interact in e.g. R GUI or R Studio) to a txt-file post hoc then that would be equally good.Tried google and TFM ![]() Many thanks and a good weekend to all. — Pass or fail! ElMaestro |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2017-09-02 07:20 (2791 d 19:00 ago) @ ElMaestro Posting: # 17761 Views: 5,374 |
|
Hi ElMaestro, the meaning of 'stdout'? outputs on the console? If yes, you can try zz<- file("output.txt",open="wt") I am not quite sure if I answer your question correctly or not. — All the best, -- Yung-jin Lee bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan https://www.pkpd168.com/bear Download link (updated) -> here |
ElMaestro ★★★ Denmark, 2017-09-02 10:10 (2791 d 16:09 ago) @ yjlee168 Posting: # 17762 Views: 5,321 |
|
Thanks yjlee168, for trying to help. ![]() I looked at this code already, I believe it is from StackOverflow. It is an example on how to send stdout to a file, and then how to stop doing that so that messages end up on the console again. What I need is both simultaneously and that's how I am of the impression that sink() might not be the solution."stdout" is where dos (console) applications, for lack of better terminology, output their stuff. When we open the R GUI or other interface and type a command we are in effect only talking to R's console via a layer of handy windowing which uses stdout and stdin to communicate with R and display to us in a nice windowsy manner what is going on. If I could save an entire session (with all R's messages) to a file then that would also be great. ![]() — Pass or fail! ElMaestro |