Re: [Rd] opening graphics device with a given number

From: Henrik Bengtsson <hb_at_biostat.ucsf.edu>
Date: Sat, 13 Nov 2010 05:09:56 -0800

See devSet() in R.utils, e.g.

> library("R.utils");
> graphics.off();
> devSet(6);
> devSet("myFigure"); # Also possible
> print(devList());

myFigure Device 6

       2 6
>

/Henrik

On Sat, Nov 13, 2010 at 2:44 AM, Petr Savicky <savicky_at_cs.cas.cz> wrote:
> I am preparing a script, which uses three graphical windows for different
> types of plots. Before each plot, the device can be chosen by dev.set(k)
> for k = 2, 3, 4. The function dev.set(k) does not create the required
> device, if it is not opened already. So, instead, i use dev.add(k)
> defined as
>
>  dev.add <- function(k)
>  {
>      stopifnot(k >= 2 && k <= 63)
>      while (all(dev.list() != k)) {
>          dev.new()
>      }
>      dev.set(k)
>  }
>
> If the device k was not opened, then all the devices with numbers
> smaller than k, which were not opened already, are created.
> Usually, i use an interval of the device numbers, but sometimes,
> it could be useful to open, say, device 4, even if device 3
> is not needed. Is there a way, how to open a device with a
> given number without opening devices with smaller numbers?
>
> Petr Savicky.
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 13 Nov 2010 - 13:16:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 13 Nov 2010 - 19:00:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive