[R] dev.list() not a list?

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Feb 15 13:04:18 CET 2000


On Tue, 15 Feb 2000, Bill Simpson wrote:

> Isn't dev.list() a list? I am using R-0.99a

It is a `list', but not an object of mode "list".

> > dev.list()
> NULL
> > is.list(dev.list())
> [1] FALSE
> > is.null(dev.list())
> [1] TRUE
> Fine.
> 
> 
> > x11()
> > dev.list()
> X11 
>   2 
> > is.null(dev.list())
> [1] FALSE
> > is.list(dev.list())
> [1] FALSE
> What is it then, if not a list? Is this a bug?

A named vector. No. .Devices is an R list, though.

(Someone has been copying S-PLUS here, hence the name dev.list.)

> My basic problem: I want my function to do
> x11(height=6, width=6, pointsize=20)
> if no x11 window is open yet (if dev.list() is NULL)

Well, those are different. Either test if is.null(dev.list()), or
if names(dev.cur()) != "X11".

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list