How do you print to stderr in R?

Frank picture Frank · Jul 10, 2009 · Viewed 31.5k times · Source

How do you print to stderr in R?

This would especially useful for scripts written in Rscript.

Answer

Frank picture Frank · Jul 10, 2009

Actually the following works for me:

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

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