Oftentimes I want to make outputs to be displayed on the R console. However, after I execute a program with a sink command in it the R console becomes unresponsive. Meaning that the following occurs in R console:> source("Program_containing_sink.R") > a<-1 > a > >sink() >a >R help says that sink() will bring output back to the console but i's not happening. Restarting R fixes the problem. This has been driving me nuts and I'm sure there's an easy answer but after a week I'm still not sure. R 2.15.1 GUI 1.52 is what's being used. Thanks for any help [[alternative HTML version deleted]]
We can't really diagnose the problem without a repeatable example (that is, what's in your R file?). But my suspicion is that you've called sink(filename) more than once. Simply type sink() at the command prompt until you get the warning: In sink() : no sink to remove And then all should be well. On Fri, Nov 9, 2012 at 2:07 PM, Dan Baron <danbenbar at gmail.com> wrote:> Oftentimes I want to make outputs to be displayed on the R console. > However, after I execute a program with a sink command in it the R console > becomes unresponsive. Meaning that the following occurs in R console: > >> source("Program_containing_sink.R") >> a<-1 >> a >> >>sink() >>a >> > > R help says that sink() will bring output back to the console but i's not > happening. Restarting R fixes the problem. This has been driving me nuts > and I'm sure there's an easy answer but after a week I'm still not sure. R > 2.15.1 GUI 1.52 is what's being used. >-- Sarah Goslee http://www.functionaldiversity.org
sink.number() will give you an idea of how many 'sinks' you might have nested. On Fri, Nov 9, 2012 at 2:07 PM, Dan Baron <danbenbar at gmail.com> wrote:> Oftentimes I want to make outputs to be displayed on the R console. > However, after I execute a program with a sink command in it the R console > becomes unresponsive. Meaning that the following occurs in R console: > >> source("Program_containing_sink.R") >> a<-1 >> a >> >>sink() >>a >> > > R help says that sink() will bring output back to the console but i's not > happening. Restarting R fixes the problem. This has been driving me nuts > and I'm sure there's an easy answer but after a week I'm still not sure. R > 2.15.1 GUI 1.52 is what's being used. > > Thanks for any help > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.