Skip to content
Prev 83151 / 398506 Next

how to specify dev.print target by a variable?

G'day Leif,
LK> How do I do this such that I can specify FOO to be one of
    LK> several choices? (GDD, PNG, postscript, etc.)  If I make FOO a
    LK> character variable, then "dev.print" complains.
Mmh, I am not sure what the complaint of R 2.2.0 on MS Windows is, but
I guess it is the same as under linux:
Error in dev.copy(device = "png", file = fname, width = DEVw, height = DEVh,  : 
	'device' should be a function

Which is very informative.  `device' is supposed to be a function, not
a character variable, thus:
X11 
  2
X11 
  2 

all seem to work.

HTH.

Cheers,

        Berwin

========================== Full address ============================
Berwin A Turlach                      Tel.: +61 (8) 6488 3338 (secr)   
School of Mathematics and Statistics        +61 (8) 6488 3383 (self)      
The University of Western Australia   FAX : +61 (8) 6488 1028
35 Stirling Highway                   
Crawley WA 6009                e-mail: berwin at maths.uwa.edu.au
Australia                        http://www.maths.uwa.edu.au/~berwin