Re: [Rd] interactive graphics devices
On Tue, 18 Dec 2007, Byron Ellis wrote: > I probably missed this discussion, but why not just ASK the device if > it is interactive? I can easily imagine a case where a device might be > interactive or not depending on how it was started. In fact, I don't > have to imagine a case since the Quartz device in R-devel can have > exactly this behavior. Something like a Cairo device might also have > this behavior, though I don't know if the current Cairo devices > support it. You cannot ASK a device you have not yet opened: see the 'orNone' argument to dev.interactive(). Beyond that, there is nothing in the graphics device API to ask an open device. There are two Cairo devices in two packages and they behave differently: that makes it rather difficult to determine the behaviour by name. > On Dec 18, 2007 4:34 PM, Paul Murrell <[EMAIL PROTECTED]> wrote: >> Hi >> >> For all developers of add-on graphics devices: please note the >> existence of deviceIsInteractive() for adding your device to the list of >> devices for which dev.interactive() returns TRUE. (Available since R >> 2.6.0; thanks to Brian Ripley I think) And Deepayan Sarkar. >> Paul >> -- >> Dr Paul Murrell >> Department of Statistics >> The University of Auckland >> Private Bag 92019 >> Auckland >> New Zealand >> 64 9 3737599 x85392 >> [EMAIL PROTECTED] >> http://www.stat.auckland.ac.nz/~paul/ >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > > > > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] interactive graphics devices
On 12/18/07, Byron Ellis <[EMAIL PROTECTED]> wrote: > I probably missed this discussion, but why not just ASK the device if > it is interactive? That's done if the device is open. deviceIsInteractive() takes away the guessing even when it's not (the use-case is when you type example(something) without a device open, and R has to decide whether to set par(ask = TRUE) just by looking at getOption("device")). > I can easily imagine a case where a device might be > interactive or not depending on how it was started. In fact, I don't > have to imagine a case since the Quartz device in R-devel can have > exactly this behavior. Something like a Cairo device might also have > this behavior, though I don't know if the current Cairo devices > support it. If there's ambiguity, you can choose not to use deviceIsInteractive. You'll still be OK once the device is open (I don't think there's much more that can be done). -Deepayan > On Dec 18, 2007 4:34 PM, Paul Murrell <[EMAIL PROTECTED]> wrote: > > Hi > > > > For all developers of add-on graphics devices: please note the > > existence of deviceIsInteractive() for adding your device to the list of > > devices for which dev.interactive() returns TRUE. (Available since R > > 2.6.0; thanks to Brian Ripley I think) > > > > Paul > > -- > > Dr Paul Murrell > > Department of Statistics > > The University of Auckland > > Private Bag 92019 > > Auckland > > New Zealand > > 64 9 3737599 x85392 > > [EMAIL PROTECTED] > > http://www.stat.auckland.ac.nz/~paul/ > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > > > -- > Byron Ellis ([EMAIL PROTECTED]) > "Oook" -- The Librarian > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] interactive graphics devices
I probably missed this discussion, but why not just ASK the device if it is interactive? I can easily imagine a case where a device might be interactive or not depending on how it was started. In fact, I don't have to imagine a case since the Quartz device in R-devel can have exactly this behavior. Something like a Cairo device might also have this behavior, though I don't know if the current Cairo devices support it. On Dec 18, 2007 4:34 PM, Paul Murrell <[EMAIL PROTECTED]> wrote: > Hi > > For all developers of add-on graphics devices: please note the > existence of deviceIsInteractive() for adding your device to the list of > devices for which dev.interactive() returns TRUE. (Available since R > 2.6.0; thanks to Brian Ripley I think) > > Paul > -- > Dr Paul Murrell > Department of Statistics > The University of Auckland > Private Bag 92019 > Auckland > New Zealand > 64 9 3737599 x85392 > [EMAIL PROTECTED] > http://www.stat.auckland.ac.nz/~paul/ > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Byron Ellis ([EMAIL PROTECTED]) "Oook" -- The Librarian __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] interactive graphics devices
Hi For all developers of add-on graphics devices: please note the existence of deviceIsInteractive() for adding your device to the list of devices for which dev.interactive() returns TRUE. (Available since R 2.6.0; thanks to Brian Ripley I think) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel