[Rd] printf capture

mel mel at altk.com
Thu Apr 12 11:59:10 CEST 2007


printf capture

Dear All,

I'm running R-2.4.1 on WindowsXP.
I wrote a small C++ DLL using Rprintf() and all works fine
dyn.load(), is.loaded('f1'), Rprintf(), .C(), all is ok.

Now, the worry :
I use also a 3rd party piece of C++ program which was not designed
for R and uses printf().

I though on sink(...) before .C('f1'), but it doesn't work.
I call sink(file="res.txt") and only the Rprintf() are catched

Is there any way to however capture those printf() outputs ?

Thanks for any hint/pointer (... and i apologize
if i missed something obvious !).

Vincent

(for what may be worth, a "minimal" stuff is at www.khi.fr/IB/rp2)



More information about the R-devel mailing list