rprintingstderr

How do you print to stderr in R?


How do you print to stderr in R?

This would especially useful for scripts written in Rscript.


Solution

  • Actually the following works for me:

    write("prints to stderr", stderr())
    
    write("prints to stdout", stdout())