Perfect, thanks! Naturally, now I need to resize the console so it doesn't
cover my new plots. I'd like to resize it on the fly (from within the
function) then reset the size to its previous size.

So, curConsoleDims() and resize.console() are a made up functions, but they
demonstrate what I am trying to do:

fun = function(x){
  plot(x)
  bringToTop(-1)    #bring console to top (activate console or give console
control) thanks Bert!
  dims = curConsoleDims()
  on.exit(dims)
  resize.console(width=100,height=100)
}
fun(1:4)

Thanks!

Ben

On Wed, Nov 16, 2011 at 10:37 AM, Bert Gunter <gunter.berton@gene.com>wrote:

> ??focus   ## admittedly, not the first keyword that comes to mind
> ?bringToTop
>
> -- Bert
>
> On Wed, Nov 16, 2011 at 9:07 AM, Ben quant <ccquant@gmail.com> wrote:
> > Hello,
> >
> > After I plot something how do I reactivate the console (and not the plot
> > window) so I don't have to click on the console each time to go to the
> next
> > command?
> >
> > Example that does not work:
> >
> > fun = function(x){ plot(x); dev.set(dev.prev())}
> > fun(1:4)
> >
> > ...and another that does not work:
> > fun = function(x){ plot(x); dev.set(NULL)}
> > fun(1:4)
> >
> > Again, by 'not work' I mean I can't seem to give control back to the
> > console after I plot. I didn't find anything online.
> >
> > thanks,
> >
> > Ben
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@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.
> >
>
>
>
> --
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> Internal Contact Info:
> Phone: 467-7374
> Website:
>
> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
>

	[[alternative HTML version deleted]]

