[R] Preventing .Call from printing a blank line to the R console on Windows

Duncan Murdoch murdoch at stats.uwo.ca
Thu Jun 11 01:04:49 CEST 2009


On 10/06/2009 5:16 PM, Joel wrote:
> Hello everyone,
> 
> I am using the CVODES integrator in the Rsundials package.  Every time
> I call the integrator, a blank line is printed in the console.  Using
> debug, I was able to isolate the problem to this line in the function
> cvodes(...):
> 
> solutions = .Call("cvodes", PACKAGE = "Rsundials", as.double(y), ...
> 
> Since I am running the integrator thousands of times, I wind up with
> thousands of blank lines.  This makes it hard to print out periodic
> updates from a for loop; they are lost among all the blank lines!
> 
> Is it somehow possible to stop this .Call command from printing a
> blank line?

The best way is to fix the package so it doesn't do that, but a 
workaround using capture.output() or sink() is probably possible.

Duncan Murdoch




More information about the R-help mailing list