[R] source, echo...and clicking the mouse

Greg Snow Greg.Snow at imail.org
Thu Jun 30 23:33:52 CEST 2011


On some operating systems (which we don't know yours, see the posting guide) the output is buffered and including a call to flush.console() will flush all the output from the buffer to the console.  Put the function call throughout the script and when it is run it will stop buffering for a bit.

The other possibility is that your script does some plotting and that is what is pausing until you click.  In that case you need to use a different graphics device or methodology to avoid this (see ?interactive).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Steven Wolf
> Sent: Thursday, June 30, 2011 3:16 PM
> To: 'David Winsemius'
> Cc: r-help at r-project.org
> Subject: Re: [R] source, echo...and clicking the mouse
> 
> How does flush.console() work?
> 
> Am I supposed to put anything in the parentheses?
> 
> When I type it in I get:
> > flush.console()
> NULL
> 
> Thanks,
> -Steve
> 
> -----Original Message-----
> From: David Winsemius [mailto:dwinsemius at comcast.net]
> Sent: Thursday, June 30, 2011 4:40 PM
> To: Steven Wolf
> Cc: r-help at r-project.org
> Subject: Re: [R] source, echo...and clicking the mouse
> 
> 
> On Jun 30, 2011, at 4:16 PM, Steven Wolf wrote:
> 
> > I'm attempting to view the progress of a script that I call on my
> > screen as
> > follows:
> >
> > source("myscript.R", echo=TRUE)
> >
> > When it is running, I have to click my mouse in the GUI window for
> > anything
> > to show up.   I am wondering if I can change something so that it
> > writes to
> > my GUI window automatically.
> >
> > I've been trying to work through the documentation for the source
> > function, but I am at a loss.
> >
> > I am running the 64 bit RGui v 2.13.0
> >
> > My OS is Windows 7.
> 
> 
> ?flush.console
> 
> --
> David Winsemius, MD
> West Hartford, CT
> 
> ______________________________________________
> 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.



More information about the R-help mailing list