views:

145

answers:

1

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?
+2  A: 

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.

Harlan
it happens to me often, and i usually just restart the R session. Now I have a better solution, thanks!
Eduardo Leoni