[R] is this trellis device or standard graphics device?

Paul Murrell p.murrell at auckland.ac.nz
Thu Mar 29 01:32:08 CEST 2007


Hi


Prasenjit Kapat wrote:
> OK, here is the issue:
> I have a graphcis device (say X11) which I can set as active by
> dev.set(n). Is there ANY way to identify/infer whether this X11 device
> was obtained from a lattice function (like xyplot, levelplot...) or a
> standard function (like plot, scatterplot,...).


You could call the grid function getNames() and if that is zero-length,
then the device is either blank or only contains traditional graphics.


> A related question is whether plot.new (or frame) was called to obtain
> this graphics device...


Try ...

recordPlot()[[1]][[1]]

... which should look something like this after plot.new() ...

[[1]]
.Primitive("plot.new")

[[2]]
NULL

... though you're starting to get on shakier ground here.

Paul



> Thanks.
> PK
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



More information about the R-help mailing list