Question

I'm working on a big Sweave document/script on a Mac OS X system, R version 2.9.2. Under some circumstances, it appears as if Sweave is redirecting stdout, so that x <- 1; print(x) gives nothing at all. (The console is still running, as plot(x) pops up a plot as normal.) So, two questions:

  1. How do I force stdout to go back to the console, and,
  2. Why does Sweave do this, and how?
Was it helpful?

Solution

Found it, with extensive use of RSeek. The sink() function redirects the console to a file. sink(NULL) cancels the redirection. Still not entirely sure why Sweave sets up a sink. I suspect that bugs in my code were causing Sweave to abort without canceling the sink.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top