[R] Ask for help on the parallel function output to a pdf file

Dirk Eddelbuettel edd at debian.org
Sun Feb 20 23:09:00 CET 2005


On 21 February 2005 at 08:35, Warren.Jin at csiro.au wrote:
| However, if these commands are encapsulated into a function, the
| resultant pdf file is empty. For example, we define a simple function
| paraExam below, paraExam() may generate a pdf file which is empty from a
| pdf viewer. 
| 
| paraExam<-function(file="trial.pdf"){
|  library(lattice);
|  pdf(file);
|  data(iris);
|  parallel(~iris[1:4] | Species, iris);
|  dev.off();
|  }

It's the (current) mother of all FAQs: You need a print() about your lattice
plot command, i.e.

   print(parallel(~iris[1:4] | Species, iris))

Dirk

PS You can drop the ';'.


-- 
Better to have an approximate answer to the right question than a precise 
answer to the wrong question.  --  John Tukey as quoted by John Chambers




More information about the R-help mailing list