3

Is there a way to fully log (stdin, stdout, stderror) a R session executed via Rscript in batch mode?

I know, that I can use R CMD BATCH to log the full session of a batch job. I also know how to write errors and output into a logfile using Rscript but since it is often said that R CMD BATCH is a relict from the old days and one should use Rscript, I was wondering if it can also log everything.

I suppose it is impossible but I am not sure - neither do I know why.

6
  • Did you try Rscript --save? Commented Feb 3, 2014 at 19:57
  • @agstudy This saves the workspace but it does not log anything -- right. Commented Feb 3, 2014 at 20:29
  • how about -e "sink('logfile.txt')" ? Commented Feb 4, 2014 at 3:57
  • nope, that doesnt do anything except creating 'logfile.txt' ... I tried: Rscript -e "sink('logfile.txt')" getQuotes.r Commented Feb 4, 2014 at 9:10
  • 1
    YES, Why not? ... I want to see where the errors happened what ran through and what might have given a warning or whatever. Separating might be nice sometimes but having all three in one file is neat most of the times when human instead of machine has to look at the stuff. Commented Dec 9, 2014 at 4:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.